OK, I got the Arduino Plug-in working and I can compile stuff that uses some basic stuff. However, I tried to port over a project that uses libraries added to the "libraries" folder. When I try to compile, I get a unresolved inclusion error on the header for the added library.
The library I am trying to access, I did not write. The author of the library requested that this folder be added as a sub-folder to the libraries folder. I did this and the code does compile fine using the Arduino IDE. However, if fails right away when attempting to compile with Eclipse.
The source code references the library with the line.
#include <OpenSprinkler.h>
When compiling with the IDE, the console window then contains -IH:\Arduino\arduino-0022\libraries\OpenSprinkler
which lets the compiler know where to find the needed pieces.
With Eclipse, there is no inclusion of this library and thus the compile fails.
How do I tell Eclipse to look in the "libraries" tree?
Is there an example project that demonstrates how to use library stuff from Eclipse?
Thank you for pointing out what I was missing. After importing the library, I was able to get it to compile. However, I did have to do one more step. I had to include the library folders in the C++ compiler settings.
Attached is a screen shot of my addition to my project:
Perhaps I did something wrong on the import. (Highly likely) Or perhaps it is a function of the project that I am attempting to port over. The header for the Library is referenced by just "#include <OpenSprinkler.h>" Do I need more of a path declaration to let the indexer know the location of the header?
Anyway, thanks again. I have this project compiling and linking now, so the question are more about how to do it correctly, the next time I import.
Steve
As your image shows the plugin added $workspace_loc:/Sprinkler_Shedule/OpenSprinkler
So your addition was not needed.
See This page has been moved for more info on the indexer.
If I delete both on my additional include paths, then the code will not compile. For the code to compile, the second include that I added is required. The library author placed source code for a twi driver in a utility folder that is under the OpenSprinkler folder. (I do not know why this was done.) The Arduino IDE figures out that this code is in a lower folder and includes this folder level when compiling some stuff.
Other than this lower folder, you are correct. The code will compile everything else without the first include I added. I mistakenly thought that it would not compile without this because if I search for unresolved headers, then OpenSprinkler appears in the unresolved list unless I add that first include. I mention this because, while it appears in the list, it is not a real problem. At compile time, it can resolve this header.
Steve
The fact that you need the library sub folder utility in your include path is IMHO a bug in the OpenSprinkler code.
Note that the Arduino Eclipse plugin includes all the subfolders of the imported library (except for example) as code folders but only includes the top level to the include path.
IMHO this how proper encapsulation is done.
So as to me you are reporting a bug in the OpenSprinkler code and not my Arduino Eclipse plugin.