0

I am trying to add two libraries, libfreertos.a and STemWin532_CM7_IAR.a to an Eclipse C/C++ project in order to program a STM32f7 board. I keep getting

cannot find -llibfreertos.a

and

cannot find -lSTemWin532_CM7_IAR.a

errors.

This is the command Eclipse tries to execute:

arm-none-eabi-gcc -mcpu=cortex-m7 -mthumb -mfloat-abi=hard -mfpu=fpv5-sp-d16 -L"C:\Users\q73624\Documents\STM32_Workspace\Wallbox_Sys_Workbench\Middlewares\ST\STemWin\Lib" -specs=nosys.specs -specs=nano.specs -T"../STM32F746NGHx_FLASH.ld" -Wl,-Map=output.map -Wl,--gc-sections -o "Wallbox_Sys_Workbench.elf" @"objects.list"  -l"libfreertos.a" -l"STemWin532_CM7_IAR.a"

I am aware of C++: External library in eclipse CDT

[1]: C++: External library in eclipse CDT, but that post was for linux, so I am not sure what applies to my case. I also tried with full path and without the '.a' extension, nothing seemed to work. Please give some advice.

  • 1
    Then don't use `-l` -- this flag *prepends* a "lib" to the name and searches for it in the library search path. Instead, just add the plain full pathname to your lib at the end of the command line, without any flag. –  Apr 04 '18 at 13:24
  • @FelixPalmen, I tried to do so. I used this command : arm-none-eabi-gcc -mcpu=cortex-m7 -mthumb -mfloat-abi=hard -mfpu=fpv5-sp-d16 -L"C:\Users\q73624\Documents\STM32_Workspace\Wallbox_Sys_Workbench\Middlewares\ST\STemWin\Lib" -specs=nosys.specs -specs=nano.specs -T"../STM32F746NGHx_FLASH.ld" -Wl,-Map=output.map -Wl,--gc-sections -o "Wallbox_Sys_Workbench.elf" @"objects.list" . I get an undefined reference for each function call from the libraries. – user3810317 Apr 05 '18 at 07:15
  • There are no libs on that command line... –  Apr 05 '18 at 08:34
  • @FelixPalmen, I added them this time : arm-none-eabi-gcc -mcpu=cortex-m7 -mthumb -mfloat-abi=hard -mfpu=fpv5-sp-d16 -L"C:\Users\q73624\Documents\STM32_Workspace\Wallbox_Sys_Workbench\Middlewares" -specs=nosys.specs -specs=nano.specs -T"../STM32F746NGHx_FLASH.ld" -Wl,-Map=output.map -Wl,--gc-sections -o "Wallbox_Sys_Workbench.elf" @"objects.list" "C:/Users/q73624/Documents/STM32_Workspace/Wallbox_Sys_Workbench/Middlewares/Third_Party/libfreertos.a" "C:/Users/q73624/Documents/STM32_Workspace/Wallbox_Sys_Workbench/Middlewares/Third_Party/STemWin532_CM7_IAR.a" . It still can't find the files. – user3810317 Apr 10 '18 at 05:54
  • Then the path is not correct! Problem could be the forward slash vs backslash confusion, as well as a shell "eating" backslashes (so you would need to write double-backslash). Without access to your system, I can't tell for sure, try to experiment yourself. –  Apr 11 '18 at 05:05
  • Thank you, @FelixPalmen . I finally got it to work by using the library names without "lib" prefix and without ".a" extension. – user3810317 Apr 12 '18 at 06:32

0 Answers0