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
Hello all,
For a new project I need to add some link flags in a linked command file.
Especially, we have to add a Library path. This path is located in the workspace outside the project.
So we have add:
-l "C:/D/Workspace_CCSV8/MyWorkspace/LibProject/Debug/COMMON.lib"
It works, but it is a little bit dirty. I would like to avoid full path in this file, therefore, we have written:
-l "${workspace_loc}/LibProject/Debug/COMMON.lib"
which is not working.
So, how to add CCS8 or environment variable in linker command file?
Thanks a lot.
Alain
Hi Ozino, I want to add
I am aware of adding library in the project properties. I want to add library in linker command file. I need to avoid full path in this file, so, I need to use variable in this file.
(when using the full path it woks fine)
Here, the line in my linker command file
-l ${workspace_loc}/MyWorkspace/Debug\COMMON.lib
And the result:
Invoking: C2000 Linker
"C:/D/ti/ccs800/ccsv8/tools/compiler/ti-cgt-c2000_18.1.1.LTS/bin/cl2000" -v28 -ml -mt --cla_support=cla1
--float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 -O0 --fp_mode=relaxed --define=LAUNCHPAD -g
--diag_warning=225 --diag_wrap=off --display_error_number -k --asm_listing --c_src_interlist
--gen_preprocessor_listing -z -m"EQSW_COM.map" --stack_size=0x200 --warn_sections
-i"C:/D/ti/ccs800/ccsv8/tools/compiler/ti-cgt-c2000_18.1.1.LTS/lib"
-i"C:/D/ti/ccs800/ccsv8/tools/compiler/ti-cgt-c2000_18.1.1.LTS/include"
--priority --reread_libs --diag_wrap=off --display_error_number --xml_link_info="EQSW_COM_linkInfo.xml" --rom_model
-o "EQSW_COM.out" "./main/ECU_COM_main.obj" "./main/ECU_start.obj" "../_link_cmd/ECU_COM_FLASH_lnk.cmd"
"../_link_cmd/ECU_COM_IO_lnk.cmd" "../_link_cmd/ECU_COM_lnk.cmd" -llibc.a
<Linking>
error #10008-D: cannot find file "${workspace_loc}/MyWorkspace/Debug/COMMON.lib"
As you can see, the variable is not resolved when used in linked command file. Is there a way to solve this issue?
Thanks for your help
Alain
Alain,
I understand your question. With regards to linking the library in the linker command file. You could try adding the .lib to your project workspace and then simply linking directly to the name i.e -l COMMON.lib. This should work.
Regards,
Ozino