Go Down

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

B2

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

B2

B2

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

  extern HardwareSerial Serial;

And now it builds just fine.

B2

kiwidude

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:
http://www.arduino.cc/playground/Code/Eclipse

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.

Marius

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

https://github.com/mariusl/Eclipse-for-AVR

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.

kiwidude

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