This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

L6200E : Symbol Multiply Defined - possible solution

I have been searching for a solution to this problem, here on forum and I didn't seem to have found one. So I did a little experimenting with codes, and what I believe I have found a solution (not a very logical one, but this worked for me). The reason why I am starting this thread is because I don't know how to answer to those who started threads with same Summary, and I want to give my idea on how to solve this.

I noticed that I had this problem when I wanted to declare something in .h file, and then declare it in two .c files (rookie mistake ). What made this work for me, is that I "connect" two .c files by including the same header in both files, and declare the variable (which seem to have been multiply defined ) in only one .c file.

For example, I had main.c file and shoot.c file and there was a header shoot.h. I included shoot.h in both main.c and shoot.c, and then declared (and later defined in the same file) a variable in shoot.c file. I didn't have to write extern anywhere, and I just used it in main.c file (without "extern-declaring" it in main file)

Hope this helps to those having this problem, and if possible, leave some feedback!

Thank you for reading this!