As I recall you also need to surround the header files with:
#ifdef __cplusplus
extern "C" {
#endif
at the top, and for the bottom:
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
extern "C" {
#endif
at the top, and for the bottom:
#ifdef __cplusplus
}
#endif