Hello,
I am trying to use math functions from both math.h and c67xfastMath.lib in a file. I have had no problem with other C-files in my project if I only use functions
from either "math.h" or "c67xfastMath.lib" however in this one particular file I need functions from both libraries.
I am getting the following compile/linker error:
----------------------------------------------------
"C:/Program Files/Texas Instruments/ccsv4/tools/compiler/C6000 Code Generation Tools 7.3.5/bin/cl6x" -mv6740 --symdebug:none -O3 --include_path="C:/c67xmathlib_2_01_00_00/inc" --include_path="C:/Program Files/Texas Instruments/ccsv4/tools/compiler/C6000 Code Generation Tools 7.3.5/include" --include_path="C:/Documents and Settings/WBarie/My Documents/workspace/basic_drive/Debug" --include_path="C:/Program Files/Texas Instruments/bios_5_41_10_36/packages/ti/bios/include" --include_path="C:/Program Files/Texas Instruments/bios_5_41_10_36/packages/ti/rtdx/include/c6000" --diag_warning=225 --abi=coffabi --optimizer_interlist --opt_for_speed=5 -k --asm_listing --preproc_with_compile --preproc_dependency="autotune.pp" --c64p_dma_l1d_workaround "../autotune.c"
'Finished building: ../autotune.c'
' '
'Building target: basic_drive.out'
'Invoking: Linker'
"C:/Program Files/Texas Instruments/ccsv4/tools/compiler/C6000 Code Generation Tools 7.3.5/bin/cl6x" -mv6740 --symdebug:none -O3 --diag_warning=225 --abi=coffabi --optimizer_interlist --opt_for_speed=5 -k --asm_listing -z -m"basic_drive.map" --warn_sections -i"C:/Program Files/Texas Instruments/ccsv4/tools/compiler/C6000 Code Generation Tools 7.3.5/lib" -i"C:/Program Files/Texas Instruments/ccsv4/tools/compiler/C6000 Code Generation Tools 7.3.5/include" -i"C:/Program Files/Texas Instruments/bios_5_41_10_36/packages/ti/rtdx/lib/c6000" -i"C:/Program Files/Texas Instruments/bios_5_41_10_36/packages/ti/bios/lib" --reread_libs --rom_model -o "basic_drive.out" -l"./basic_drivecfg.cmd" "./state.obj" "./reset.obj" "./ramp.obj" "./pwm.obj" "./protection.obj" "./precharge.obj" "./pi_loop.obj" "./param.obj" "./overload.obj" "./mtrctl.obj" "./meter.obj" "./main.obj" "./io_led.obj" "./io_dac.obj" "./io_blvds_bus.obj" "./io_arm.obj" "./init.obj" "./info.obj" "./filter.obj" "./fault.obj" "./edma.obj" "./controlfbk.obj" "./control.obj" "./basic_drivecfg_c.obj" "./basic_drivecfg.obj" "./autotune.obj" -l"C:\c67xmathlib_2_01_00_00\lib\c67xfastMath.lib" -l"libc.a" "../c67xfastMath.lib" "../vfd.cmd"
<Linking>
error: symbol "_sqrtf" redefined: first defined in "C:/Program Files/Texas
Instruments/ccsv4/tools/compiler/C6000 Code Generation Tools
7.3.5/lib/rts6740.lib<sqrtf.obj>"; redefined in
"C:\c67xmathlib_2_01_00_00\lib\c67xfastMath.lib<sqrtsp.obj>"
error: errors encountered during linking; "basic_drive.out" not built
>> Compilation failure
gmake: *** [basic_drive.out] Error 1
gmake: Target `all' not remade because of errors.
----------------------------------------------------
I understand that the fast math library is a subset of the normal math library but in this case it appears that the fast math library
and the normal math library are not working together properly.
Following SPRU100a section 2.3.2, I have added "c67xfastMath.lib" to my CCS project.
I have also added "c67xfastMath.lib" to the "Build Properties/C6000 Linker/" "Include library file" box and inserted it as the first item.
In Build Properties/C6000 Compiler/Include options I have also included "c67xfastMath.lib" as the first item in the list.
I only have problems with one particular C-file that needs to use fast math functions "sqrtsp" and "sinsp" as well as normal math functions such\
as "acosf".
I have tried various combinations of adding the fast math include and removing the include from various project settings inside Code Composer
but end up with either this exact issue or some similar linker issue
More background:
CCS ver 4.2.5.0005
C6000 Codegen tools 7.3.5
Can someone please provide help in resolving this issue?
Walt B.