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.
Tool/software: TI C/C++ Compiler
Hi!
I have a floating problem with our project. Last time it occured when I copied project file and tried to use it for an another project. Linking fails with message:
<Linking>
error #10056: symbol "fputs" redefined: first defined in "/.../Our.lib.lib<debug.obj>"; redefined in "/opt/ti/ccs710/ccsv7/tools/compiler/ti-cgt-c6000_8.1.3/lib/rts6600_elf.lib<fputs.obj>"
error #10010: errors encountered during linking; "Module.Our.out" not built
Our.lib.lib contains a system stuff.
Application code in source files.
Linking command:
Invoking: C6000 Linker
"/opt/ti/ccs710/ccsv7/tools/compiler/ti-cgt-c6000_8.1.3/bin/cl6x" -mv6600 -O2 --opt_for_speed=4 -g --define=___ --diag_warning=225 --diag_wrap=off --display_error_number --asm_listing -z -m"Module.Our.map" -i"/opt/ti/ccs710/ccsv7/tools/compiler/ti-cgt-c6000_8.1.3/lib" -i"/opt/ti/ccs710/ccsv7/tools/compiler/ti-cgt-c6000_8.1.3/include" --reread_libs --display_error_number --diag_wrap=off --warn_sections --xml_link_info="Module.Our_linkInfo.xml" --rom_model -o "Module.Our.out" "./module.obj" "./___.obj" "./.../src/......obj" ".......obj" "........obj" ".........obj" "........obj" ".......obj" "../rm_linker.cmd" -l"configPkg/linker.cmd" -l"/...../Our.lib.lib" -llibc.a
I tried to change link order. Tried to remove --reread_libs and add --priority.
It doesn't help.
I'don't udnerstand why linker uses fputs from 'standard library'... And why the project builds successfully on other machines or in another time.
Code Composer Studio Version: 7.1.0.00016. xdctools_3_32_00_06.
What generally works best in these situations is to use --priority, make sure the linker sees each library name exactly one time, and those library names are in the order they should be used.
I suspect something in the these linker command files ...
Andrey Grechin said:"../rm_linker.cmd" -l"configPkg/linker.cmd"
... is affecting things. Do these files have any library names or linker options that are connected to this?
Thanks and regards,
-George
Thanks for the additional detail. I can reproduce the problem. I filed CODEGEN-2367 in the SDOWP system to have this addressed. It contains a detailed description of what went wrong. I hesitate to include the entire explanation here. One critical detail is that the STL header calls the function puts in panic situations, like when memory allocation fails. This starts a chain of unusual circumstances that end with the link failing.
One workaround is to additionally supply the function puts in your custom library Our.lib.lib. It can then call your fputs. Is this practical?
Thanks and regards,
-George