5 years, 3 months ago.

mbed build error on terminal.

Hi everybody, I am trying build blink code on my ubuntu desktop. I export project at online compiler with expert settin cmake-gcc-arm. Then run cmake . command there is no problem. Cmake create a makefile then run make command. Taking like below error :

make Scanning dependencies of target blue_pill [ 25%] Building CXX object CMakeFiles/blue_pill.dir/main.cpp.obj [ 50%] Linking CXX executable blue_pill /usr/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/bin/ld: warning: cannot find entry symbol Reset_Handler; defaulting to 0000000008000000 CMakeFiles/blue_pill.dir/main.cpp.obj: In function `mbed::Serial::Serial()': /home/abd/Downloads/blue_pill/mbed/drivers/Serial.h:53: undefined reference to `mbed::Stream::Stream()' /home/abd/Downloads/blue_pill/mbed/drivers/Serial.h:53: undefined reference to `mbed::SerialBase::SerialBase()' /home/abd/Downloads/blue_pill/mbed/drivers/Serial.h:53: undefined reference to `vtable for mbed::Serial' CMakeFiles/blue_pill.dir/main.cpp.obj: In function `_GLOBALsub_I_pc': /home/abd/Downloads/blue_pill/main.cpp:5: undefined reference to `mbed::Serial::Serial(PinName, PinName, char const*, int)' CMakeFiles/blue_pill.dir/main.cpp.obj: In function `_GLOBALsub_I_pc': /home/abd/Downloads/blue_pill/mbed/drivers/DigitalOut.h:56: undefined reference to `gpio_init_out' /usr/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/libc.a(lib_a-call_atexit.o): In function `register_fini': call_atexit.c:(.text.startup.register_fini+0x6): undefined reference to `wrap_atexit' collect2: error: ld returned 1 exit status CMakeFiles/blue_pill.dir/build.make:113: recipe for target 'blue_pill' failed make[2]: * [blue_pill] Error 1 CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/blue_pill.dir/all' failed make[1]: * [CMakeFiles/blue_pill.dir/all] Error 2 Makefile:83: recipe for target 'all' failed make: * [all] Error 2

Be the first to answer this question.