Go Down

Topic: Library from unix style file organization (Read 962 times) previous topic - next topic


I coded a C library with unix file organization:

/include -----> public headers (library interface)
/src -----> source files, private headers, subfolders, etc.

I can't load the library. I try that:

header.h ---> #include "include/header1.h" etc but this way can't foun the sources.

Is there a way to load this library without file organization?

Thank you


but this way can't foun the sources.
The reason is explained in the Arduino library specification:
There are two different formats of Arduino libraries:

1.0: At least one header file in the root folder. Source files in the library root folder and the utility subfolder are compiled.
1.5: No header file in the root folder, library.properties file in the root folder. Source files in the src subfolder are compiled recursively.

So the only way you can accomplish your desired structure is to "pollute" your src folder by moving header.h into it and then adding a library.properties file to the root folder. Information on the library.properties file format here:

Go Up