eclipse, arduino, and twi.h

I've been really struggling to get Arduino setup on my Ubuntu installation in Eclipse. I have managed to get the avr tool chain set up via the instructions at Arduino Playground - Eclipse. I did the simple blink program and downloaded it successfully. Life was good.

Then i started calling header files like liquidcyrstal.h and that is when things fell apart. I think i am having trouble with eclipse including all the arduino .h files.

I got the .a file from copying the library from an Arduino IDE project as described in the link above. I tried to build my project and eclipse complained it couldn't find Arduino.h. i found a copy on disk and included it in the includes.

I built again and that error went away but then it started composing it couldn't find twi.h. argh! Are all of these arduino header files in one place on an Ubuntu install and if so where are they?? Should this really be this difficult?

Did you use Jantje's Arduino plugin? If not you will have to add refences to all your include files. If you used the Eclipse version with Jantje's plugin (see www.baeyens.it), all you have to do is define the path to the Arduino IDE, and to your user libraries and you are done. Works like a charm on both my Windows and Ubuntu machines.

The Arduino IDE sometimes changes things, making it incompatible with other software. The compilier options, the directory structure, everything should work together.
Even using the Arduino files from the repositories is often of problem, because they could be a previous version.

I scrolled through that page about Eclipse, there are so many things to do and so many things that can go wrong, it's insane.

If you still want to make this work, al least let Eclipse compile all the libraries from source. Don't use compiled libraries. I tried other development environments (more programmer friendly), but now I just use the newest version of the Arduino IDE. That causes the least problems.

One of the things that the Arduino IDE does for you is that for every occurrence of something like:

#include <i2c.h>

The IDE will add the appropriate "-I ~/Documents/Arduino/libraries/blah/" (or "-I /Arduino.../libraries/Wire/" for standard libraries) (and apparently blah/utility as well! Perhaps a nice recursive descent through any library directory it finds...) to the compile command. It also builds the libraries and includes them in the link of the final sketch.

To use a fancier IDE, you'll have to duplicate that functionality manually, or by some other mechanism.