a9183756-gh / Arduino-CMake-Toolchain

CMake toolchain for all Arduino compatible boards
MIT License
135 stars 40 forks source link

Arduino Nano 33 BLE: undefined reference to `main' #50

Open mkettn opened 2 years ago

mkettn commented 2 years ago

Many thanks for this great toolchain! I've found a bug when compiling for Arduino Nano 33 BLE. When linking any project (for example Blink) you get the error: ~/.arduino15/packages/arduino/hardware/mbed_nano/2.5.2/variants/ARDUINO_NANO33BLE/libs/libmbed.a(mbed_boot_gcc_arm.o): In function __wrap_main': mbed_boot_gcc_arm.c:(.text.__wrap_main+0x0): undefined reference tomain'

I think the archives and objects are linked in the wrong order, since the main.cpp where the main function gets defined is compiled too.