AnsweredAssumed Answered

undefined reference to <function>

Question asked by Andrew Meyer on Dec 31, 2014
Latest reply on Jan 6, 2015 by Alice_Yang

Using KDS, using Git, having trouble with libraries.  The learning curve is killing me.

 

I am trying to create a library of small functions to call from my main code.  The error I get is undefined reference to <function>.  The linker command line is thus.

 

c:/freescale/kds_2.0.0/toolchain/bin/../libexec/gcc/arm-none-eabi/4.8.0/collect2.exe --sysroot=/work/joes/kds-releases/2.0.0/install/i686-w64-mingw32/arm-none-eabi -X -o comm.elf c:/freescale/kds_2.0.0/toolchain/bin/../lib/gcc/arm-none-eabi/4.8.0/crti.o c:/freescale/kds_2.0.0/toolchain/bin/../lib/gcc/arm-none-eabi/4.8.0/crtbegin.o c:/freescale/kds_2.0.0/toolchain/bin/../lib/gcc/arm-none-eabi/4.8.0/../../../../arm-none-eabi/lib/crt0.o -LC:/Freescale/git/comm/comm/Project_Settings/Linker_Files -Lc:/freescale/kds_2.0.0/toolchain/bin/../lib/gcc/arm-none-eabi/4.8.0 -Lc:/freescale/kds_2.0.0/toolchain/bin/../lib/gcc -Lc:/freescale/kds_2.0.0/toolchain/bin/../lib/gcc/arm-none-eabi/4.8.0/../../../../arm-none-eabi/lib --gc-sections -Map comm.map --cref ./Sources/Events.o ./Sources/main.o ./Project_Settings/Startup_Code/startup.o ./Generated_Code/AS1.o ./Generated_Code/ASerialLdd1.o ./Generated_Code/Cpu.o ./Generated_Code/PE_LDD.o ./Generated_Code/Vectors.o -llibchars -lstdc++ -lm --start-group -lgcc -lg_s -lc_s --end-group c:/freescale/kds_2.0.0/toolchain/bin/../lib/gcc/arm-none-eabi/4.8.0/crtend.o c:/freescale/kds_2.0.0/toolchain/bin/../lib/gcc/arm-none-eabi/4.8.0/crtn.o -T C:/Freescale/git/comm/comm/Project_Settings/Linker_Files/ProcessorExpert.ld

 

The functions are called in events and created in libchars, so I think the order is correct.  Both events and libchars are C++ projects as far as I can determine--C projects don't have the C++ portion of the build chain.

 

In the project explorer, the directories libchars and libchars/debug are in purple folder icons--would love to know what that means.  I can "click through" from the function to it's definition without problems.  Can anyone give me something else to try?

 

Thanks.

Outcomes