Help with my arduino library: no such file

I added a library manually to my sketchbook, it shows in the included library list but ti's still not working. I'm sure the file 'board,h' is in the library. What could possibly be the problem? Thank you.


image

The library name is the 'mikrosdk_v2-master'

libraries have nothing to do with tools or boards

Installation and Troubleshooting is for Problems with the Arduino IDE itself NOT your project. It says so in the description of the section. Therefore I have moved your post here.

You might want to look at this [How to get the best from this from this Forum (How to get the best out of this forum) before you proceed any further.

Hi @rootspapapa. First of all I think it will be important for you to provide more information:

Please provide a link to where you found the code that includes the #include directive for boards.h.

Please tell us what made you think you needed to install this "mikrosdk_v2-master" library. If you are following some instructions, please provide a link to them.

I'm not implying that you are necessarily in error in these things. We simply need more information to understand the situation.

I will share some information about how #include directives are handled in Arduino IDE. Even though it is not necessarily relevant to the problem you are experiencing, it is something that is generally useful to understand and perhaps interesting as well.

When you compile a sketch, Arduino IDE does a process referred to as "library discovery", where the installed libraries are searched for any header files in the #include directives of the sketch code which were not found by the compiler in its include search paths. Once discovered, the library's path is added to the compiler's include search paths.

Only the files in the root of the library's source folder searched during library discovery.

Once the library's path has been added to the compiler's include search path, it is then possible to include additional header files from subfolders by using the file's path relative to the root of the source folder in the #include directive.

For example, let's say you have installed a library with this structure:

FooLib/
├── Foo.h
└── bar/
    └── Bar.h

Compiling this sketch:

#include <Bar.h>
void setup() {}
void loop() {}

Will fail with the error;

Bar.h: No such file or directory

A similar error will occur when compiling the sketch with the correct relative path in the #include directive:

#include <bar/Bar.h>
void setup() {}
void loop() {}
bar/Bar.h: No such file or directory

But if you cause the library to be discovered by adding an #include directive for the Foo.h file in the root of the library's source folder (which is the root of the library in this example), then the bar/Bar.h header can also be #included:

#include <Foo.h>
#include <bar/Bar.h>
void setup() {}
void loop() {}

Note that the #include directive for the file in the root of the source folder must come first.

Generally it is not necessary to use #include directives for header files in subfolders of libraries in your sketch because the library author typically puts the header files that serve as the public interface in the root of the source folder, reserving subfolders for files used internally by the library's own code.

From the path shown in the File Explorer screenshot you shared, it is clear the file board.h is not in the root of the source folder:

image

so a "board.h: No such file or directory" error message is normal and expected for an #include directive like:

#include <board.h>

Thank you. That helps.

This is the library i first want to use, and i find it unable to upload the zip file as a library, so i added the file manually by adding the file of it into the 'library' in my sketchbook. And then this seems to worked. But the examples in this library uses 3 other libraries,
Other mikroE Libraries used in the example:

That isn't an Arduino Library. You can learn about mikroSDK here:

Ok, Thank you for your help! :grinning:

You are welcome. I only wish I had better news or more effective assistance for you.

I hope you will be able to find an appropriate Arduino library, or else find success with mikroSDK.

Regards,
Per

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.