Kan niet van clion naar arduino uploaden

I'm trying to upload a script to my arduino uno (mega and nano doesn't work either). It works unless I #include

#include 
#include 
#include 
#include 

#define OLED_RESET  4

Adafruit_SSD1306 display(OLED_RESET);

// initializing foo here. const static unsigned char foo_bits[] PROGMEM = {0x00, 0x00 ///

void draw(void) {
    display.drawXBitmap( 0, 0,foo_bits, foo_width, foo_height, 1);
    display.display();
}


void setup(void) {
    display.begin();
    display.clearDisplay();
}

void loop(void) {
    draw();
}

De fout die ik krijg is

libuno_Adafruit_SSD1306.a(Adafruit_SSD1306.cpp.obj): In function `Adafruit_SSD1306::ssd1306_command(unsigned char)':
/opt/arduino/arduino-1.8.5/libraries/Adafruit_SSD1306/Adafruit_SSD1306.cpp:416: undefined reference to `Wire'
/opt/arduino/arduino-1.8.5/libraries/Adafruit_SSD1306/Adafruit_SSD1306.cpp:416: undefined reference to `Wire'
/opt/arduino/arduino-1.8.5/libraries/Adafruit_SSD1306/Adafruit_SSD1306.cpp:416: undefined reference to `TwoWire::beginTransmission(int)'
/opt/arduino/arduino-1.8.5/libraries/Adafruit_SSD1306/Adafruit_SSD1306.cpp:416: undefined reference to `Wire'
/opt/arduino/arduino-1.8.5/libraries/Adafruit_SSD1306/Adafruit_SSD1306.cpp:416: undefined reference to `Wire'
/opt/arduino/arduino-1.8.5/libraries/Adafruit_SSD1306/Adafruit_SSD1306.cpp:416: undefined reference to `TwoWire::write(unsigned char)'
/opt/arduino/arduino-1.8.5/libraries/Adafruit_SSD1306/Adafruit_SSD1306.cpp:416: undefined reference to `Wire'
/opt/arduino/arduino-1.8.5/libraries/Adafruit_SSD1306/Adafruit_SSD1306.cpp:416: undefined reference to `Wire'
/opt/arduino/arduino-1.8.5/libraries/Adafruit_SSD1306/Adafruit_SSD1306.cpp:416: undefined reference to `TwoWire::write(unsigned char)'
/opt/arduino/arduino-1.8.5/libraries/Adafruit_SSD1306/Adafruit_SSD1306.cpp:416: undefined reference to `Wire'
/opt/arduino/arduino-1.8.5/libraries/Adafruit_SSD1306/Adafruit_SSD1306.cpp:416: undefined reference to `Wire'
/opt/arduino/arduino-1.8.5/libraries/Adafruit_SSD1306/Adafruit_SSD1306.cpp:416: undefined reference to `TwoWire::endTransmission()'
libuno_Adafruit_SSD1306.a(Adafruit_SSD1306.cpp.obj): In function `Adafruit_SSD1306::begin(unsigned char, unsigned char, bool)':
/opt/arduino/arduino-1.8.5/libraries/Adafruit_SSD1306/Adafruit_SSD1306.cpp:416: undefined reference to `SPIClass::begin()'
libuno_Adafruit_SSD1306.a(Adafruit_SSD1306.cpp.obj): In function `SPIClass::beginTransaction(SPISettings)':
/opt/arduino/arduino-1.8.5/libraries/Adafruit_SSD1306/Adafruit_SSD1306.cpp:416: undefined reference to `SPIClass::interruptMode'
/opt/arduino/arduino-1.8.5/libraries/Adafruit_SSD1306/Adafruit_SSD1306.cpp:416: undefined reference to `SPIClass::interruptMode'
/opt/arduino/arduino-1.8.5/libraries/Adafruit_SSD1306/Adafruit_SSD1306.cpp:416: undefined reference to `SPIClass::interruptSave'
/opt/arduino/arduino-1.8.5/libraries/Adafruit_SSD1306/Adafruit_SSD1306.cpp:416: undefined reference to `SPIClass::interruptMask'
/opt/arduino/arduino-1.8.5/libraries/Adafruit_SSD1306/Adafruit_SSD1306.cpp:416: undefined reference to `SPIClass::interruptSave'
libuno_Adafruit_SSD1306.a(Adafruit_SSD1306.cpp.obj): In function `Adafruit_SSD1306::begin(unsigned char, unsigned char, bool)':
/opt/arduino/arduino-1.8.5/libraries/Adafruit_SSD1306/Adafruit_SSD1306.cpp:416: undefined reference to `Wire'
/opt/arduino/arduino-1.8.5/libraries/Adafruit_SSD1306/Adafruit_SSD1306.cpp:416: undefined reference to `Wire'
/opt/arduino/arduino-1.8.5/libraries/Adafruit_SSD1306/Adafruit_SSD1306.cpp:416: undefined reference to `TwoWire::begin()'
libuno_Adafruit_SSD1306.a(Adafruit_SSD1306.cpp.obj): In function `Adafruit_SSD1306::display()':
/opt/arduino/arduino-1.8.5/libraries/Adafruit_SSD1306/Adafruit_SSD1306.cpp:472: undefined reference to `Wire'
/opt/arduino/arduino-1.8.5/libraries/Adafruit_SSD1306/Adafruit_SSD1306.cpp:472: undefined reference to `Wire'
/opt/arduino/arduino-1.8.5/libraries/Adafruit_SSD1306/Adafruit_SSD1306.cpp:472: undefined reference to `TwoWire::beginTransmission(int)'
libuno_Adafruit_SSD1306.a(Adafruit_SSD1306.cpp.obj): In function `TwoWire::write(int)':
/opt/arduino/hardware/arduino/avr/libraries/Wire/src/Wire.h:78: undefined reference to `Wire'
/opt/arduino/hardware/arduino/avr/libraries/Wire/src/Wire.h:78: undefined reference to `Wire'
/opt/arduino/hardware/arduino/avr/libraries/Wire/src/Wire.h:78: undefined reference to `TwoWire::write(unsigned char)'
libuno_Adafruit_SSD1306.a(Adafruit_SSD1306.cpp.obj): In function `Adafruit_SSD1306::display()':
/opt/arduino/arduino-1.8.5/libraries/Adafruit_SSD1306/Adafruit_SSD1306.cpp:475: undefined reference to `Wire'
/opt/arduino/arduino-1.8.5/libraries/Adafruit_SSD1306/Adafruit_SSD1306.cpp:475: undefined reference to `Wire'
/opt/arduino/arduino-1.8.5/libraries/Adafruit_SSD1306/Adafruit_SSD1306.cpp:475: undefined reference to `TwoWire::write(unsigned char)'
/opt/arduino/arduino-1.8.5/libraries/Adafruit_SSD1306/Adafruit_SSD1306.cpp:479: undefined reference to `Wire'
/opt/arduino/arduino-1.8.5/libraries/Adafruit_SSD1306/Adafruit_SSD1306.cpp:479: undefined reference to `Wire'
/opt/arduino/arduino-1.8.5/libraries/Adafruit_SSD1306/Adafruit_SSD1306.cpp:479: undefined reference to `TwoWire::endTransmission()'
collect2: error: ld returned 1 exit status

Mijn cMake-bestand is

cmake_minimum_required(VERSION 2.8.4)
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/ArduinoToolchain.cmake)
set(PROJECT_NAME touch)
project(${PROJECT_NAME})
include_directories(/opt/arduino/arduino-1.8.5/libraries/)
set(${CMAKE_PROJECT_NAME}_SKETCH touch.ino)

set(${CMAKE_PROJECT_NAME}_BOARD uno)
set(${CMAKE_PROJECT_NAME}_PORT /dev/ttyACM0)
generate_arduino_firmware(${CMAKE_PROJECT_NAME})

Als ik alle Adafruit_SS1306 uploadwerken verwijder. Exact hetzelfde programma werkt vanuit Arduino IDE. Wat kan de oorzaak zijn en hoe kan ik dit oplossen?

0
Het lijkt erop dat je geplaatste schets niet overeenkomt met jouw foutmeldingen. U hebt die foo_ * -variabelen nooit opgegeven. Heb je je bibliotheken bijgewerkt?
toegevoegd de auteur user31481, de bron
De fout zit in de bibliotheek, niet in je schets. Dat gebeurt van tijd tot tijd. Je code compileert goed in mijn machine (na het toevoegen van foo_ * definities) met behulp van Arduino 1.8.5 en UECIDE 0.9.1. Geduld.
toegevoegd de auteur user31481, de bron
Er zijn hier schitterende mensen. Wacht op hun
toegevoegd de auteur user31481, de bron
De foo-variabelen zijn allemaal gedeclareerd (zie de commentaarregel in de schets, wilde gewoon de code kort houden en foo_bytes is vrij lang). De schets werkt vanuit Arduino IDE en de bibliotheken zijn bijgewerkt. @LookAlterno
toegevoegd de auteur Anonymous, de bron
@LookAlterno Maar ja - ik zie ook geen enkel verband tussen schets en fout, wat dit erg moeilijk maakt om voor mij te maken ...
toegevoegd de auteur Anonymous, de bron
Geduld? Waarvoor? @LookAlterno
toegevoegd de auteur Anonymous, de bron

Geen antwoorden

0