Including header files in sketch folder

Status
Not open for further replies.

tenkai

Well-known member
So this question is not quite teensy specific.

I am having troubles including header files when compiling using the Arduino IDE.

I normally use Stino with Sublime Text, and when compiling there, any .h and .cpp files that are properly tagged and referenced will compile in with my program.

For various reasons I need to compile my program in the Arduino IDE from time to time, but I get

Code:
afx-01a.ino:9:23: fatal error: Sequencer.h: No such file or directory
compilation terminated.

when I attempt to compile.

Anybody know a workaround?
 
What is the first rule of this forum? Post your code.

There's a few things you might have got wrong, which may work on other platforms but don't work on Arduino. Just the #include line should be enough to see the problem.
 
Here is my code:
https://github.com/cosmikwolf/afx-01a

the Sequencer.h file is included at the root of the project, and is included as:

#include <Sequencer.h>

It works fine when compiling using Stino, but does not work when compiling using Arduino 1.0.6.

I did not post my code, because I asked as a general inquiry if it is possible to include header files at the root of the sketch, as I described
 
Did not test, but local includes should be with quotes. If I am correct, arduino does not add a "-I." when compiling, so it might not find it.
Code:
#include <library.h>
#include "local.h"
 
Ah that worked!

I did not realize there was a difference between brackets and quotes in include lines

Thanks kpc!
 
Long tradition is that files in braces are system or library or some such. Files in double-quotes are user header files.
Traditionally, there are different search paths for each for simplicity and control (e.g., on *nix machines) the <file.h> path is read-only for most users but "myfile.h" can be read/write.

I suspect Arduino doesn't conform.
 
Status
Not open for further replies.
Back
Top