TI E2E Community
TI C/C++ Compiler
TI C/C++ Compiler - Forum
Linking problem: redefinition issue
I am building a c++ project from command like in ccsv5.
While linking I am getting a redefinition error from multiple object file for a variable which is used as "local variable" in all the files.Not sure why a local variable symbol is getting rdfined while linking. Also the error is not coming while the complete project compilation.
error #10056: symbol "eRc" redefined: first defined in "../build/obj/App.o"; redefined in "../../A/B/build/obj/Entity.o"
Most likely, this variable is a global variable defined in a header file. The declaration of a variable in a header file should use the "extern" keyword.
If this is not the problem, please post a compilable test case that demonstrates the problem.
Yes, you are right.By mistake we left a global definition i header file.
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.