Quote:Why is not the #include statement sufficient like it seem to be for all the other #include statements. According to the standard C/C++ I think it should.
It's a good question.
Normally an, such as Eclipse and Visual Studio, ide will compile only what is included in the project.
Normally for .h files this doesn't matter so much because they don't need to be compiled, simply available as #includes.
Normally we can #include headers from anywhere such as "..\..\foo\foo.h"
BUT
For Arduino all the .ino files have to be combined into a .cpp and some extra code added. So for Arduino the build always happens in a temp folder, can't happen where the sources are actually located. This is foreign for most ide's so we are in new territory.
Consider now that if we copy the sources to a temp folder and attempt to find "..\..\foo\foo.h" it becomes a problem.
I think Visual Micro could help by automatically copying all files from the project folder to the temp folder. However things would become less consistent because if users see one file that is not "Included" in the project being found they will wonder why others can't be found.
So currently the rule is, include files in the project and they will be found and copied to the temp build folder.
I am trying to give options to move away from this constraint. You see in the last release that a project_name.cpp is supported instead of .ino files. In that case Visual Micro will use the local project folder sources in the build and the header would have been found regardless of it's inclusion in the project.
However don't rush to use a .cpp only system without understanding the following rules:-
1) A project_name.ino must still be included in the project but it can be empty and is ignored except to show which headers should be included after clicking "add library"
2) You are responsible for adding #include "arduino.h" to the project_name.cpp
3) You are responsible for creating function prototypes in the project_name.cpp or a header file.
tip: The build folder will provide a ready-made .cpp with your .ino files, prototypes etc. as an example to get going with.
As you can imagine. By removing ourselves from the .ino files and temp build folder we can start to work like a normal .cpp project however the new facility can not impact support. It is up to users to understand what is happening and to decide this is how they want to work.
Hope that helps.
Finally the error you publish is exactly the same as the error we discussed previously in this thread and the same error you get in the arduino ide. So it is a code problem.