cancel
Showing results for 
Search instead for 
Did you mean: 

CMAKE build works only in IDE

JKol
Associate

Hello,
I have successfully created a new cmake project in IDE 1.16. Everything I need works - the project is successfully compiled, the BIN file is successfully run in the MCU:

[ 97%] Building C object CMakeFiles/KubergCMAKE.dir/Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_uart_ex.c.obj

[100%] Linking C executable KubergCMAKE.elf

text data bss dec hex filename

48528 128 3376 52032 cb40 C:/Projekty/KubergCMAKE/Release/KubergCMAKE.elf

[100%] Built target KubergCMAKE

 

13:57:54 Build Finished. 0 errors, 0 warnings. (took 16s.631ms)

 

However, I am unable to compile the project from the command line window.
cmake --build Release

This command only succesfuly compile source files - 100% done, but when try to lining:
[100%] Linking C executable KubergCMAKE.elf

ends with this error:

.......
............
CMakeFiles/KubergCMAKE.dir/Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_uart_ex.c.obj : No such file or directory
collect2.exe: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/KubergCMAKE.dir/build.make:639: KubergCMAKE.elf] Error 1
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/KubergCMAKE.dir/all] Error 2

 

Has anyone solved the same problem?

Thank You, Jan.

0 REPLIES 0