Advanced Library question

Hi,

I'm trying to write a library. The thing is, it should be quite versatile and not limited to the Arduino. But it seems that a library for Arduino can only consist of one(!) C++ class and its header in the library's root directory. No subdirectories (at least stuff in there isn't found by the build system).

Is it possible to coax the arduino build system to accept subdirectories and somehow specify what to build? Can someone point me to an explanation how the build system works in the first place?

Thanks
Roddi

Its not that the library is limited to a single class, so much as it is limited to a single cpp file. You can code multiple classes within that cpp file. I don't know of a way to have multiple directories of files in a library...

how manu cpp you want but no subdirectory. times ago i've posted a patch but it's gone

wanderson:
Its not that the library is limited to a single class, so much as it is limited to a single cpp file. You can code multiple classes within that cpp file. I don't know of a way to have multiple directories of files in a library...

Ok. Do I have to use C++ at all or could I do all this in plain C too?

You should take a look at the SD library - that uses multiple files and subdirectories.

no, the utility folder is hardcoded in the ide and is the only allowed name, and if i remember correctly, it only works is lib is in arduino default folder (and i think it's a bad practice mix "original" and "3° part" lib)

roddi:
But it seems that a library for Arduino can only consist of one(!) C++ class and its header in the library's root directory.

As Majenko said, the SDFat library has multiple files, and multiple classes, so that statement simply isn't true.

It also has multiple classes.

Ok. Do I have to use C++ at all or could I do all this in plain C too?

Other libraries, like UsbDevice, has multiple files, .c, .cpp, .asm, and other files.