Skip to main content
OLenz.1
Associate II
July 18, 2020
Solved

CubeIDE: Build fails (make: returns with error 2)

  • July 18, 2020
  • 5 replies
  • 3555 views

Hi

I try to build a small project (only timer interrupt triggered led blinking) to get familiar with the basic tools. But CubeIDE quits a build with following:

08:47:42 **** Incremental Build of configuration Debug for project SandkastenF3 ****
make -j4 all 
arm-none-eabi-gcc -o "SandkastenF3.elf" @"objects.list" -l"C:/Users/usersname/E-Technik/Bibliotheken\ und\ Projektdateien/STM32/SandkastenF3/Core/libraries/ledcircle/" -mcpu=cortex-m4 -T"C:\Users\usersname\E-Technik\Bibliotheken und Projektdateien\STM32\SandkastenF3\STM32F303VCTX_FLASH.ld" --specs=nosys.specs -Wl,-Map="SandkastenF3.map" -Wl,--gc-sections -static --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -Wl,--start-group -lc -lm -Wl,--end-group
c:\program files\st\stm32cubeide_1.3.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610\tools\arm-none-eabi\bin\ld.exe: cannot find -lC:/Users/usersname/E-Technik/Bibliotheken\ und\ Projektdateien/STM32/SandkastenF3/Core/libraries/ledcircle/
collect2.exe: error: ld returned 1 exit status
make: *** [makefile:45: SandkastenF3.elf] Error 1
"make -j4 all" terminated with exit code 2. Build might be incomplete.

Has anyone an idea to solve this, please?

This topic has been closed for replies.
Best answer by hs2

Better use -L to specify your (add) library paths and use e.g. -lledcircle to link with libledcircle.a.

It’s wise to avoid paths with spaces to avoid trouble and extra work with quoting.

5 replies

TDK
July 18, 2020

> cannot find -lC:/Users/usersname/E-Technik/Bibliotheken\ und\ Projektdateien/STM32/SandkastenF3/Core/libraries/ledcircle/

My guess is it doesn't play well with spaces in paths. Remote the spaces from the path and see if that solves it.

"If you feel a post has answered your question, please click ""Accept as Solution""."
OLenz.1
OLenz.1Author
Associate II
July 18, 2020

Well, I tried this before, but unfortunately without success.

16:49:37 **** Build of configuration Debug for project SandkastenF3 ****
make all 
arm-none-eabi-gcc -o "SandkastenF3.elf" @"objects.list" -l"C:/Users/usersname/Desktop/SandkastenF3/Core/libraries/ledcircle/" -mcpu=cortex-m4 -T"C:\Users\usersname\Desktop\SandkastenF3\STM32F303VCTX_FLASH.ld" --specs=nosys.specs -Wl,-Map="SandkastenF3.map" -Wl,--gc-sections -static --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -Wl,--start-group -lc -lm -Wl,--end-group
c:\program files\st\stm32cubeide_1.3.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610\tools\arm-none-eabi\bin\ld.exe: cannot find -lC:/Users/usersname/Desktop/SandkastenF3/Core/libraries/ledcircle/
collect2.exe: error: ld returned 1 exit status
make: *** [makefile:45: SandkastenF3.elf] Error 1
"make all" terminated with exit code 2. Build might be incomplete.

hs2
hs2Best answer
Visitor II
July 18, 2020

Better use -L to specify your (add) library paths and use e.g. -lledcircle to link with libledcircle.a.

It’s wise to avoid paths with spaces to avoid trouble and extra work with quoting.

OLenz.1
OLenz.1Author
Associate II
July 18, 2020

"Better use -L to specify your (add) library paths and use e.g. -lledcircle to link with libledcircle."

Ok...but how to do?

OLenz.1
OLenz.1Author
Associate II
July 18, 2020

Ok, I found the option. Now it works.

Maybe there was another problem: The builder option was at "external builder". I set it to "internal builder" ans put the -L-option in, now it works. :)

Thanks.