Go Down

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

EA3HVJ

Hello,
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:

/include
/src
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

pert

but this way can't foun the sources.
The reason is explained in the Arduino library specification:
https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5:-Library-specification#source-code
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:
https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5:-Library-specification#libraryproperties-file-format

Go Up