This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

lwm2m_client sample fails with "Compiling the C compiler identification source file "CMakeCCompilerId.c" failed."

Hello, 

I am trying to build the lwm2m_client sample on my ubuntu 16.04 machine.  I tried building for nrf9160_pca10090ns and nrf9160_pca20035ns The build fails with:

ninja: build stopped: subcommand failed.
ERROR: command exited with status 1: /usr/local/bin/cmake --build /home/pascal/nrf/samples/nrf9160/lwm2m_client/build

When I look at the CMakeError.log file this is what it says:

Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: /opt/gnuarmemb/gcc-arm-none-eabi-8-2019-q3-update/bin/arm-none-eabi-gcc 
Build flags: 
Id flags:  

The output was:
1
/opt/gnuarmemb/gcc-arm-none-eabi-8-2019-q3-update/bin/../lib/gcc/arm-none-eabi/8.3.1/../../../../arm-none-eabi/bin/ld: /opt/gnuarmemb/gcc-arm-none-eabi-8-2019-q3-update/bin/../lib/gcc/arm-none-eabi/8.3.1/../../../../arm-none-eabi/lib/libc.a(lib_a-exit.o): in function `exit':
exit.c:(.text.exit+0x2c): undefined reference to `_exit'
collect2: error: ld returned 1 exit status


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: /opt/gnuarmemb/gcc-arm-none-eabi-8-2019-q3-update/bin/arm-none-eabi-g++ 
Build flags: 
Id flags:  

The output was:
1
/opt/gnuarmemb/gcc-arm-none-eabi-8-2019-q3-update/bin/../lib/gcc/arm-none-eabi/8.3.1/../../../../arm-none-eabi/bin/ld: /opt/gnuarmemb/gcc-arm-none-eabi-8-2019-q3-update/bin/../lib/gcc/arm-none-eabi/8.3.1/../../../../arm-none-eabi/lib/libc.a(lib_a-exit.o): in function `exit':
exit.c:(.text.exit+0x2c): undefined reference to `_exit'
collect2: error: ld returned 1 exit status

I should mention that I only run into this error with this one particular sample, I have successfully built applications with this compiler before.

I am not sure what this due to. I tried using a more recent compiler. I installed gcc-arm-none-eabi-9-2019-q4-major and edited my env variables accordingly but I get the same error with the new compiler as well.

Regards,

Parents Reply Children
Related