C++ 11 beim Kompilieren in Eclipse

  1. Right click your project and click Properties
  2. Under C/C++ Build click Settings
  3. Under GCC C++ Compiler, click Miscellaneous
  4. In the Other Flags box, append „-std=c++11 “ to the list of tokens.
  5. Click Apply and OK
  6. Right click on your project and click Properties
  7. Navigate to C/C++ General and Preprocessor Include Paths, Macros etc.
  8. Select the Providers tab, click on compiler settings row for the compiler you use (MINGW)
  9. Add -std=c++11 to Command to get compiler specs.
  10. Apply changes.

Will look something like this: ${COMMAND} -E -P -v -dD "${INPUTS}" -std=c++11 

aus: https://stackoverflow.com/questions/17457069/enabling-c11-in-eclipse-juno-kepler-luna-cdt

C++ für Arduino

1.) IDE wechseln. Anstatt Arduino als Plattform  auf Eclipse wechseln

  • Aktuellste Java Runtime Engine installieren
  • Aktuellste Eclipse-Version downloaden

2.) CDT (C/C++-Development-Toolkit)-Plugin hinzufügen

  • Help/Install new Software/CDT
  • MinGW (Minimalistisches GNU für Windows) installieren, damit man einen g++-Compiler hat
  • Der Ort, an dem die MinGW-Binärdatei installiert ist, muss in Eclipse in die Pfadvariable abgelegt werden
    Project/Properties/C_C++ General/Paths and Symbols -> Tab „Includes“

Eclipse: Plattform-spezifisch kompilieren

Innerhalb eines Projektes kann plattform-spezifisch kompiliert werden. Für jede neue Build-Einheit entsteht ein neuer „Debug“-Ordner.

Auswahl, für welche Plattform kompiliert werden soll
Projektordner>Properties/C/C++Build auswählen:
Unter Configuration: Auswählen der korrekten Plattform

Neue Plattform hinzufügen
Projektordner>Properties/C/C++Build auswählen:
Unter Configuration: Den rechten Knopf „Manage Configurations..“ auswählen und die neuen Build-Einstellungen aufsetzen.

Der Name, der die Build-Konfiguration erhält, dient innerhalb des Projektes als Ordnername.