Go Down

Topic: Eclipse IDE C++ and Serial.begin()/print/whatever wants to destroy my life (Read 9 times) previous topic - next topic


Has anyone resolved this problem as I am experiencing the same thing.



Well I added the following to the top of my sketch:

  extern HardwareSerial Serial;

And now it builds just fine.



No special options are required, but some settings in eclipse and the general project setup are critical. Declaring HardwareSerial extern or some such thing is definitely not required, you must have a broken setup.

Look here for a detailed explanation:

Be aware that there are quite a few bugs in the eclipse AVR plugin, and some in the eclipse CDT plugin which the AVR one is based on.


I agree with KiwiDude, you need not make special declarations. Have a look at this template workspace for Adruino that I created.


Place all three projects in the same work space. Compile each of the projects starting with the ArduinoCore and then the AdruinoLibraries and lastly the Template.

I use this work space for all my projects and never have any issues. I import libraries from the arduino/libraries directory when I need a new one. Recompile and go.
Rather people think you to be a fool than you open your mouth and confirm it.


Marius, your template archive is an interesting idea but falls flat in several ways. Your path configuration works only on doze, and only if someone installs the same way as you. Use workspace-relative paths. Your example includes Wprogram.h which barfs on anything but the one OS around that is case-insensitive. The SD library in there compiled with errors. I didn't look further, but eclipse thought boolean was undefined.

Go Up