Linking to C libraries

So, what's the procedure for linking in C libraries with the Arduino environment? I can't seem to find any instructions for it (that may just be me being blind), and I'd like to link in some FAT16 code for a project.


That does not work for libraries written for the AVR in ANSI C99 but not for the Arduino environment. I’m trying to use Roland Riegel’s SD Card/Fat16 library on an Mega board.

Poking around with the forum search reveals some stuff on the subject of getting the raw part of it to compile but not the full thing.


I'm not quite sure what you're trying to do, but I do know that if you want to call C (as opposed to C++) routines from your sketch, you need to prototype the functions this way:

extern "C" {
void myfunc1(int);
void myfunc2(long,long);

Apparently the calling sequence is different for C and C++ (I think C++ alters the entry point symbols).

At any rate, this works for me when I want to call routines in a separate tab (file) in the Arduino IDE environment.