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.
Hey there,
I am facing this error for a program where even though I have included the header file where the functions are defined, it keeps showing the error "undefined symbols remain". I have specified the include options search paths but it still does not work. Here is the error :
undefined first referenced
symbol in file
--------- ----------------
Device_initGPIO() ./sci_ex4_echoback.obj
Device_init() ./sci_ex4_echoback.obj
error #10234-D: unresolved symbols remain
error #10010: errors encountered during linking; "sci_ex4_echoback.out" not built
Could you help me with how to resolve this?
Anupama,
Did you import C2000Ware DriverLib example project or it is your custom project?
When you import the project, it has a folder called 'device' and that folder has device.c file. This file includes the implementation of these functions.
Please make sure you have device.c included in the project.
Can you attach full build log? These functions are implemented in device.c
Is this DriverLib example or your custom project? Have you modified the project setting?
I just imported the project and it build without any error.
So I imported an example file then I have made changes to it for my application. Basically it is a completely different program now. I have multiple external libraries. Only issue is I don't understand why the device_init() should be unresolved. I have added a static library to the program. Also my main program is now .cpp file and C dialect in the compiler language options is now compile program in C99 mode.
Build log:
**** Build of configuration CPU1_RAM for project sci_ex4_echoback ****
"C:\\ti\\ccs1040\\ccs\\utils\\bin\\gmake" -k -j 4 all -O
Building target: "sci_ex4_echoback.out"
Invoking: C2000 Linker
"C:/ti/ccs1040/ccs/tools/compiler/ti-cgt-c2000_21.6.0.LTS/bin/cl2000" -v28 -ml -mt --cla_support=cla2 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu0 -Ooff --define=DEBUG --define=CPU1 --c99 --c++03 --diag_suppress=10063 --diag_warning=225 --diag_wrap=off --display_error_number --gen_func_subsections=on --abi=coffabi -z -m"sci_ex4_echoback.map" --heap_size=0x600 --stack_size=0x100 --warn_sections -i"C:/Users/Anupama Vashishtha/HomeOffice/Serial/Debug" -i"C:/ti/c2000/C2000Ware_4_00_00_00/driverlib/f28004x/driverlib/ccs/Debug/" -i"C:/ti/ccs1040/ccs/tools/compiler/ti-cgt-c2000_21.6.0.LTS/lib" -i"C:/ti/ccs1040/ccs/tools/compiler/ti-cgt-c2000_21.6.0.LTS/include" --priority --reread_libs --diag_wrap=off --display_error_number --xml_link_info="sci_ex4_echoback_linkInfo.xml" --entry_point=code_start --rom_model -o "sci_ex4_echoback.out" "./sci_ex4_echoback.obj" "./ExternalLibraries/IpMtWrapper.obj" "./ExternalLibraries/MultiSensor/Dummy_sensor.obj" "./ExternalLibraries/MultiSensor/MultiSensor.obj" "./ExternalLibraries/lib-cbor/allocators.obj" "./ExternalLibraries/lib-cbor/arrays.obj" "./ExternalLibraries/lib-cbor/builder_callbacks.obj" "./ExternalLibraries/lib-cbor/bytestrings.obj" "./ExternalLibraries/lib-cbor/callbacks.obj" "./ExternalLibraries/lib-cbor/cbor.obj" "./ExternalLibraries/lib-cbor/common.obj" "./ExternalLibraries/lib-cbor/encoders.obj" "./ExternalLibraries/lib-cbor/encoding.obj" "./ExternalLibraries/lib-cbor/floats_ctrls.obj" "./ExternalLibraries/lib-cbor/ints.obj" "./ExternalLibraries/lib-cbor/loaders.obj" "./ExternalLibraries/lib-cbor/maps.obj" "./ExternalLibraries/lib-cbor/memory_utils.obj" "./ExternalLibraries/lib-cbor/serialization.obj" "./ExternalLibraries/lib-cbor/stack.obj" "./ExternalLibraries/lib-cbor/streaming.obj" "./ExternalLibraries/lib-cbor/strings.obj" "./ExternalLibraries/lib-cbor/tags.obj" "./ExternalLibraries/lib-cbor/unicode.obj" "./ExternalLibraries/sm_clib/dn_hdlc.obj" "./ExternalLibraries/sm_clib/dn_ipmg.obj" "./ExternalLibraries/sm_clib/dn_ipmt.obj" "./ExternalLibraries/sm_clib/dn_serial_mg.obj" "./ExternalLibraries/sm_clib/dn_serial_mt.obj" "./ExternalLibraries/sm_clib/dn_whmt.obj" "./device/device.obj" "./device/f28004x_codestartbranch.obj" "../28004x_generic_ram_lnk.cmd" "../driverlib.lib" -l"C:/Users/Anupama Vashishtha/HomeOffice/Serial/Debug/Serial.lib" -llibc.a
<Linking>
undefined first referenced
symbol in file
--------- ----------------
Device_initGPIO() ./sci_ex4_echoback.obj
Device_init() ./sci_ex4_echoback.obj
error #10234-D: unresolved symbols remain
error #10010: errors encountered during linking; "sci_ex4_echoback.out" not built
>> Compilation failure
makefile:184: recipe for target 'sci_ex4_echoback.out' failed
gmake[1]: *** [sci_ex4_echoback.out] Error 1
gmake: *** [all] Error 2
makefile:180: recipe for target 'all' failed
**** Build Finished ****
Hi Santosh,
I should mention that it is happening with any library that I am trying to include. It throws "unresolved symbols remain" for any function from the library that I am trying to access. What must be going wrong?
Looking at the log above, it looks like device.obj is included in the linker command, so we should not see that error.
Do you have a small trim down project which you can share, then I can try to reproduce locally.
Hi Santosh,
i think I have figured out whatthe issue is. My executable program is in .cpp format whereas the static library program is in .c. I am assuming that the output of the library is generating object files which the main program is not able to identify. Do you think this is on the right track?
If so, can you tell me how I can use c based library in a .cpp program?
I was getting an error of "unresolved symbols remain" for some functions which were defined in an external library. The external library was correctly linked in the project properties Compiler include options and Linker Include Options. The issue was that the executable program was in .cpp format whereas the static library program was in .c format. I resolved it by encapsulating the include directive in the main program in extern "C". Now I don't get the error.