I am running on Arduino 1.6.1 since I need compatibility with embedXcode.
For reference I am trying to compile something with the Arduino IDE and I constantly get the error
fatal error: Bounce2.h: No such file or directory #include <Bounce2.h>
for the Bounce2 library.
The include is not in the main sketch, but instead in a separate .h file included from another .cpp file containing some additional code which is included into the main sketch.
The library is perfectly installed under ˜/Documents/Arduino/libraries/Bounce2.
It is also visible in the Arduino IDE under "Import Library". When I click on the menu entry, it even adds the line #include <Bounce2.h> to the top of my code.
I have checked out a number of previous forum posts regarding this question, but they all contain no solution. People are just posting error messages without resolve.
rph8:
The include is not in the main sketch, but instead in a separate .h file included from another .cpp file containing some additional code which is included into the main sketch.
Include it in the main sketch as well.
ANd in my opinion 1.6.1 sucks... I'm a fan of 1.6.4 as a stable. Do you know why it breaks in 1.6.x?
Why can I not include it where it is supposed to be?
The simple answer is because it doesn't work.
The complex answer has to do with how the IDE manages the build process. Every file to be compiled is copied to a build directory. The IDE determines what files are to be compiled by scanning the directory that the sketch is in and the ino files in the sketch. It does NOT look at header files.
So, hiding the use of a library is not going to work. That your goal IS to hide the use of a library is a major reason that the build process is not enhanced to recursively scan header files.