Including problems

Hi people,

I'm programming a big multiplatform project and one of the supported platforms is Arduino.

In the project, I have a lot of libraries, but I have a problem: I only can include Arduino Libraries ( LiquidCristal, Wire, etc. ) from ino file but If I try to add an official library from another library ( stored in the sketch's directory ) It don't work.

It's possible to add the path or something? Am I doing something wrong?

I'm using the last version of Arduino IDE ( 1.0.5 ) over Windows 8 Enterprise.

Thanks!!

An aclaration:

If I copy the official libraries to the sketch folder It works... but it's very awful

User contributed libraries go in the libraries folder in the directory in which sketches are stored. The library folder should have the same name and capitalisation as that of the .h file to be included. The IDE must be closed and reopened after installing a new library.

What errors have you been getting ? Errors of the form "XXX does not name a type" mean that the program cannot find the file that is being included.

Is it possible to do from the sketch folder? I prefer not include the libraries to arduino libraries folder because the project it's multiplatform and if I move (or copy) the libraries, I ruin my project organization.

Thanks!

Yes.
Create tabs for (all) header files with names and capitalization exactly as the .h file Including the “.h”. Close Arduino GUI. Copy the needed library(ies) into your folder with the main Ino. Now, load the GUI and open your project. Edit the main program to show #include “filename.h” for each tab you created.

Capitalization is significant. Your .h file must not be in the program folder When the tab is created or the GUI will erase the contents.

I do this to allow me to:

  • encapsulate .h/.cpp into a single ZIP
  • keep slightly edited versions of libraries out of the library

Example:

In this example, the Adafruit library was seriously hacked in the program folder

#include "Adafruit_GPS.h"
#include <SoftwareSerial.h>
#include <Streaming.h>

Ray

You can add multiple file just inserting tab. Else you can create folder with header that you want to included in main program . Import using tools option

Thanks for your answers. I think they aren't very ellegant, but work. It's really necessary an Arduino IDE solid alternative!

Thanks again!

I think they aren't very elegant, but work. It's really necessary an Arduino IDE solid alternative!

Yes, and I agree completely. But, the GUI was written for beginners and intermediates, it is just a Java program that essentially is nothing more than a code editor and a console kick-off with runline options. There is nothing that the GUI does that you cannot do within the console... everything is AVR-GCC and a host of libs and bunches of Arduino headers that are very complex macros.

We find this topic coming up often and it is hard to imagine how you can satisfy the needs of the beginner and the intermediate coder without infringing a bit on the needs of the more proficient. I guess, if the workarounds are too complex and they annoy you, perhaps the AVR development environment or the Microsoft one are better options. I personally just cannot fault the Arduino developers for trying to keep things simple and I do not feel like this particular workaround is very complicated. A few tabs in the IDE and you are good to go.

Ray