Problem "finding" header file... why?

Hi all,

I've got a sketch that I'm working on - here's the directory tree:

Sketches
??? Noritake_VFD_GUU100
??? config.h
??? examples
? ??? Equalizer
? ??? Equalizer.ino
? ??? font20x32_digits.h
? ??? font5x8.h
? ??? font8x8.h
??? interface.h
??? Noritake_VFD_GUU100.cpp
??? Noritake_VFD_GUU100.h
??? parallel.cpp
??? SerialCUUW.cpp
??? SerialSignalSeparate.cpp
??? SerialSPI.cpp

In the program itself (Equalizer.ino), I point to the header files:

#include "../../config.h"
#include "../../Noritake_VFD_GUU100.h"

I know the path is right because in the "Equalizer" directory, I can type this:

ls -laF ../../Noritake_VFD_GUU100.h

...and sure enough, it's there:

-rw-r--r-- 1 root root 3130 Jul 23 12:49 ../../Noritake_VFD_GUU100.h

Yet, if I try to compile it (Arduino IDE 1.0.3 64 bit Linux), I get these errors:

Equalizer.ino:1:26: error: ../../config.h: No such file or directory
Equalizer.ino:2:39: error: ../../Noritake_VFD_GUU100.h: No such file or directory
Equalizer:11: error: ‘Noritake_VFD_GUU100’ does not name a type
Equalizer.ino: In function ‘void drawBars(const uint8_t*)’:
Equalizer:36: error: ‘vfd’ was not declared in this scope
Equalizer.ino: In function ‘void drawAverage(const uint8_t*)’:
Equalizer:52: error: ‘vfd’ was not declared in this scope
Equalizer:54: error: ‘NORITAKE_WIDTH’ was not declared in this scope
Equalizer.ino: In function ‘void drawNumbers(const uint8_t*)’:
Equalizer:72: error: ‘vfd’ was not declared in this scope
Equalizer.ino: In function ‘void setup()’:
Equalizer:82: error: ‘vfd’ was not declared in this scope

Of course, the rest of the errors come from the fact that the .h files are not being loaded. Can anyone see what the heck I'm doing wrong???

Thanks.

-- Roger

Is Noritake_VFD_GUU100 meant to be a library?

I think Noritake_VFD_GUU100 should be under libraries (not sketches) and the #include statements should not need to use the relative path to the included files.

Agreed. Move the entire folder (Noritake_VFD_GUU100) to be under Sketches/libraries, so you have:

  .../Sketches/libraries/Noritake_VFD_GUU100/...

Restart the IDE. Take out the ".." stuff from the #include. Then it should all work.

Yes it is a library.

That did it! I moved the Noritake library to the /libraries directory and kept my code in the /sketches directory. Then a simple #include <...> worked. Thank you and karma++

-- Roger

Hey Nick just wanted to thank you again. It makes perfect sense to put library code in "libraries" and sketches in the "sketches" directory. It all works like a champ now.

Why I didn't see/ realize that myself I have no idea.....

Thanks!

-- Roger

You are welcome. I may have to quote you next time we get a complaint that "the moderators aren't helpful".

:slight_smile: