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.

CCS5.5 symbol "redefined" when only one file linked

Other Parts Discussed in Thread: MATHLIB

When compiling my program, the following error occurs for multiple symbols:

error #10056: symbol "_sqrtf" redefined: first defined in
"C:/ti/ccsv5/tools/compiler/c6000_7.4.14/lib/rts67plus.lib<sqrtf.obj>";
redefined in
"..\TOOLS_LIBS\c67xmathlib_2_01_00_00\lib\c67xfastMath.lib<sqrtsp.obj>"
error #10010: errors encountered during linking; "<filename>.out" not built

I took "rts67plus.lib" out of the file search path in the linker and I'm trying to use the fastMath library instead.  However it seems to still be calling "rts67plus.lib" (I assume by default) and thus am getting redefined errors.

When I take out "c67xfastMath.lib" and include only "rts67plus.lib," I receive unresolved symbol errors.

If anyone knows how to resolve this issue that'd be great.

  • The following changes should fix the problem.

    1. Change rts67plus.lib to libc.a .  The tells the linker to choose the correct RTS library for you.  Makes the project more portable.
    2. Make sure the linker sees c67xfastMath.lib before libc.a
    3. If you use the option --reread_libs (or the equivalent -x), remove it
    4. Add the linker option --priority

    Changes 2-4 mean unresolved symbols come from the fastmath library first, the RTS library second.

    If this does fix the problem, then I need to see exactly how the linker is invoked.

    Thanks and regards,

    -George

  • Typo correction on that last post.  This line is wrong ...

    George Mock said:
    If this does fix the problem, then I need to see exactly how the linker is invoked.

    It should say: If this does not fix the problem, then I need to see exactly how the linker is invoked.

    Thanks and regards,

    -George

  • George,
    Thanks for replying. I tried your solutions and the problem still exists.
    I've even tried using only "libc.a" and I get the following error:
    "remark #10205-D: automatic RTS selection: linking in "rts67plus.lib" in place
    of index library "libc.a"
    followed by a list of the same "undefined first referenced" symbols that are output when no file is attached in the linker.
  • Please show exactly how the linker is invoked.

    Thanks and regards,

    -George

  • "C:\\ti\\ccsv5\\utils\\bin\\gmake" -k all
    'Building target: Project_rel.out'
    'Invoking: C6000 Linker'
    'Flags: --cmd_file="C:\Users\filepath\linker_cmd_file.cmd" -mv67p --abi=coffabi -O1 -ms3 --symdebug:none --define=c6727 --display_error_number --diag_warning=225 -z --stack_size=0x800 -m"Project_rel.map" --heap_size=0x800 -i"C:/Users/filepath/TOOLS_LIBS/c67xmathlib_2_01_00_00/lib" -i"C:/ti/ccsv5/tools/compiler/c6000_7.4.14/lib" -i"C:/ti/ccsv5/tools/compiler/c6000_7.4.14/include" -i"C:/ti/bios_5_42_01_09/packages/ti/rtdx/lib/c6000" -i"C:/ti/bios_5_42_01_09/packages/ti/bios/lib" --priority --xml_link_info="Project_rel_linkInfo.xml" --rom_model'
    "C:/ti/ccsv5/tools/compiler/c6000_7.4.14/bin/cl6x" -@"ccsLinker.opt" -o "Project_rel.out"
    <Linking>
    error #10056: symbol "_atan2" redefined: first defined in
    "C:/ti/ccsv5/tools/compiler/c6000_7.4.14/lib/rts67plus.lib<atan2.obj>";
    redefined in
    "..\TOOLS_LIBS\c67xmathlib_2_01_00_00\lib\c67xfastMath.lib<atan2dp.obj>"

    I currently have c67xfastMath.lib linked through the linker command file and put rts67plus.lib after (leaving the Runtime support library option in Properties > CCS General blank). Even in the Properties > CCS Build > C6000 Linker > File Search Path option I have the library with c67xfastMath.lib first in the list, but it seems that the linker is still looking at rts67plus.lib first.
  • The actual invocation of the linker is this line ...

    Josh Rauhauser said:
    "C:/ti/ccsv5/tools/compiler/c6000_7.4.14/bin/cl6x" -@"ccsLinker.opt" -o "Project_rel.out"

    That ccsLinker.opt file is auto-generated.  I wonder if it really contains what we presume it contains.  Please attach that file to your next post.  So the forum will accept it, add the file extension .txt to it.  While you are at also attach this file ...

    Josh Rauhauser said:
    C:\Users\filepath\linker_cmd_file.cmd

    Thanks and regards,

    -George

  • Within ccsLinker.opt, the linker command file and c67xfastMath.lib are called last.  I noticed that rts67plus.lib is called before that, so within the linker general options, I removed rts67plus.lib from the runtime support library and noticed that rts67plus.lib is also being called from the directory "C:/ti/ccsv5/tools/compiler/c6000_7.4.14/lib" I tried to manually call the linker command file and c67xfastMath.lib before rts67plus.lib and it shows within the newer ccsLinker.opt (not included), but I receive the same redefinition errors. 

  • The order in which the linker sees these important items is as follows ...

    -l"./PGS_PWII+DM_CIGGS_SCI_ofpcfg.cmd"
    -l"rts67plus.lib"
    "../PGS_PWII+DM_CIGGS_SCI_ofp_link.cmd"
    -l"C:\Users\Software Eng\workspace_v5_5\DMPlus_ProNav_V01\TOOLS_LIBS\c67xmathlib_2_01_00_00\lib\c67xfastMath.lib"

    Line 1 is a linker command file I have not seen.  I suspect it has no bearing on this problem, but it could.

    Line 2 is the compiler RTS library.  This needs to change to libc.a.  And it needs to appear last.

    Line 3 is the linker command file you attached in the previous post.  It contains nothing relevant to the problem.

    Line 4 is the fast math library.  This must appear before the RTS library.

    Thanks and regards,

    -George

  • As I stated in my previous post, I managed to set the fast math library before the rts library, but it still says that the symbols are first defined in the rts library and redefined in the fast math library. Are there any other suggestions you have to solving this issue? Are there different settings within the project properties that may fix the problem?
  • Josh Rauhauser said:
    As I stated in my previous post, I managed to set the fast math library before the rts library

    I'm pretty sure you only changed the File Search Path.  That is, the order in which the -i directory_name options appear.  This only affects the order in which directories are searched to find library files, the something.lib files.  This has no bearing on the order in which the linker searches the contents of those libraries.  That is controlled, among other things, by the order in which the library files appear to the linker.

    In my last post I summarized the relative positions of the library files.  The compiler RTS library appears before the fast math library.  This has to change.  Please see this post for the details of how to make that change in CCS.  That situation is not exactly the same as this one, but it is similar.

    Thanks and regards,

    -George

  • I've changed the link order as you've described and have gotten rid of the rts errors; however, now I'm getting the following error:

    error #10056: symbol "_atandp" redefined: first defined in
    "C:\ti\c67xmathlib_2_01_00_00\lib\c67xfastMath.lib<atandp.obj>"; redefined
    in "C:\ti\c67xmathlib_2_01_00_00\lib\c67xfastMath.lib<atan2dp.obj>"

    I've looked through my cssLinker.opt file and c67xfastMath.lib is only listed once and don't see where the fastmath library is referenced a second time within the project.
    Thanks,
    Josh

  • Josh,

    Please look at resolution of similar issue on e2e thread here where this is being discussed:
    e2e.ti.com/.../198784

    Please let us know if this doesn`t resolve your issue. Please note these functions are now integrated into the TI MATHLIB so we recommend you migrate to that library for continued support.

    Regards,
    Rahul