I am getting an error in all my code files "symbol "active" redefined: first defined in "./scan.obj"; redefined in "./comm.obj" "
I wanted to know how can i rectify this? I am new at coding for embedded systems.
Thank you
Anuj K
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
I am getting an error in all my code files "symbol "active" redefined: first defined in "./scan.obj"; redefined in "./comm.obj" "
I wanted to know how can i rectify this? I am new at coding for embedded systems.
Thank you
Anuj K
Anuj,
The message is saying that the symbol "active" is defined more than once. Check the referenced source files scan.c and comm.c and make sure that the symbol is only defined once. It can be referenced in multiple places but there should only be one definition.
It is hard to pinpoint the reason for the error without recreating the error and looking at the source files. However please check this reference on guidelines for declaring and defining variables and functions which should be helpful.
Anuj,
I just sent you a friend request. After you accept it, you should be able to go to my name in your Friends list and start a conversation. This will start a private conversation between us where you can attach your source files.
Please be sure to also specify which version of the compiler tools you are using and the complete command line which displays all the compiler options. If you are building with CCS, the build console view will display the command line which you can copy/paste.
An update on this for the benefit of others reading this thread:
The project files had several variables/functions defined in header files which was then included in multiple source file causing the "symbol redefined" errors by the linker. The suggestion to fix this is to declare the variables as "extern" in the header file, and then define the variable in only one source, while the others can still reference it.