It has been 10 years since I did C/C++ last time so I am totally missing the compiler vs linker phases.
I am running eclipse with the arm plugin with Sourcery as compiler/linker. Trying to use device libraries but linker fails. (compiler has found everything - I guess I have provided all the paths to all the .h files)
Linker should be linking some compiled stuff, right? Where do I take compiled library then? All I see in the Libraries folder are .c and .h files. So, how do I get any library binaries I would be linking to my stuff?
Here is my output:
‘Building file: …/myclass.cpp’
‘Invoking: ARM Sourcery Windows GCC C++ Compiler’
arm-none-eabi-g++ -I"C:\stuff\STM32F4-Discovery_FW_V1.1.0\Libraries\STM32F4xx_StdPeriph_Driver\inc" -I"C:\stuff\STM32F4-Discovery_FW_V1.1.0\Libraries\CMSIS\ST\STM32F4xx\Source\Templates" -I"C:\stuff\STM32F4-Discovery_FW_V1.1.0\Libraries\CMSIS\Include" -I"C:\stuff\STM32F4-Discovery_FW_V1.1.0\Libraries\CMSIS\ST\STM32F4xx\Include" -I"C:\stuff\STM32F4-Discovery_FW_V1.1.0\Libraries\STM32F4xx_StdPeriph_Driver\src" -O0 -Wall -Wa,-adhlns=“myclass.o.lst” -fno-exceptions -fno-rtti -c -fmessage-length=0 -MMD -MP -MF"myclass.d" -MT"myclass.d" -mcpu=cortex-m4 -mthumb -g3 -gdwarf-2 -o “myclass.o” “…/myclass.cpp”
‘Finished building: …/myclass.cpp’
’ ’
‘Building target: tft2.elf’
‘Invoking: ARM Sourcery Windows GCC C++ Linker’
arm-none-eabi-g++ -T"C:\Documents and Settings\andrey\workspace\tft2\stm32_flash.ld" -L"C:\stuff\STM32F4-Discovery_FW_V1.1.0\Libraries" -L"C:\stuff\STM32F4-Discovery_FW_V1.1.0\Libraries\STM32F4xx_StdPeriph_Driver\src" -L"C:\stuff\STM32F4-Discovery_FW_V1.1.0\Libraries\CMSIS\Include" -L"C:\stuff\STM32F4-Discovery_FW_V1.1.0\Libraries\CMSIS\ST\STM32F4xx\Source\Templates" -L"C:\stuff\STM32F4-Discovery_FW_V1.1.0\Libraries\CMSIS\ST\STM32F4xx\Include" -Wl,-Map,tft2.map -mcpu=cortex-m4 -mthumb -g3 -gdwarf-2 -o “tft2.elf” ./LibraryHacks.o ./MillisecondTimer.o ./myclass.o
c:/program files/codesourcery/sourcery_codebench_lite_for_arm_eabi/bin/…/lib/gcc/arm-none-eabi/4.6.3/…/…/…/…/arm-none-eabi/bin/ld.exe: warning: cannot find entry symbol Reset_Handler; defaulting to 08000000
./MillisecondTimer.o: In function `myn::MillisecondTimer::initialise()':
C:\Documents and Settings\andrey\workspace\tft2\Debug/…/MillisecondTimer.cpp:33: undefined reference to `SystemCoreClock’
C:\Documents and Settings\andrey\workspace\tft2\Debug/…/MillisecondTimer.cpp:33: undefined reference to `SystemCoreClock’
collect2: ld returned 1 exit status
cs-make: *** [tft2.elf] Error 1