queezythegreat / arduino-cmake

Arduino CMake Build system
648 stars 216 forks source link

Sketches do not compile if the board is set to leonardo #54

Closed mdaffin closed 11 years ago

mdaffin commented 11 years ago

If you set the default board to leonardo then skectches (including the example ones) do not compile and produce the follow errors:

/usr/share/arduino/hardware/arduino/cores/arduino/USBCore.cpp:78:2: error: 'USB_VID' was not declared in this scope
/usr/share/arduino/hardware/arduino/cores/arduino/USBCore.cpp:78:2: error: 'USB_PID' was not declared in this scope
/usr/share/arduino/hardware/arduino/cores/arduino/USBCore.cpp:81:2: error: 'USB_VID' was not declared in this scope
/usr/share/arduino/hardware/arduino/cores/arduino/USBCore.cpp:81:2: error: 'USB_PID' was not declared in this scope
queezythegreat commented 11 years ago

Hi, those defines are not being define by Arduino-Cmake, thats why you are getting the error. Arduino-CMake will have to be updated to take into account the new options that appeared in the latest version of the Arduino SDK.

The changes are not extensive, so it should be fixed soon. For now, you can use the following, to fix the problem:

add_definitions(-DUSB_VID=0x2341)
add_definitions(-DUSB_PID=0x8036)

Add those two lines to the CMakeLists.txt. These two defines are only used by the Leonardo. Please add this after the project() command.

cypresi commented 9 years ago

i have the same problem, with an arduino micro, any help?