Is there a C++ version of the FatFS library?

I am trying to incorporate fatfs into a cpp project and I havent been able to compile the project even though I added the

#ifdef __cplusplus
extern "C"
{
#endif

in the header file. I may have missed something. Has anyone been able to do this?

Here is the section where I added the extern

#ifdef __cplusplus
extern "C"
{
#endif

/*-----------------------------------------------------*/
/* FatFs module application interface */

extern FRESULT f_mount (BYTE, FATFS*); /* Mount/Unmount a logical drive */
extern FRESULT f_open (FIL*, const char*, BYTE); /* Open or create a file */
extern FRESULT f_read (FIL*, void*, WORD, WORD*); /* Read data from a file */
extern FRESULT f_write (FIL*, const void*, WORD, WORD*); /* Write data to a file */
extern FRESULT f_lseek (FIL*, DWORD); /* Move file pointer of a file object */
extern FRESULT f_close (FIL*); /* Close an open file object */
extern FRESULT f_opendir (DIR*, const char*); /* Open an existing directory */
extern FRESULT f_readdir (DIR*, FILINFO*); /* Read a directory item */
extern FRESULT f_stat (const char*, FILINFO*); /* Get file status */
extern FRESULT f_getfree (const char*, DWORD*, FATFS**); /* Get number of free clusters on the drive */
extern FRESULT f_sync (FIL*); /* Flush cached data of a writing file */
extern FRESULT f_unlink (const char*); /* Delete an existing file or directory */
extern FRESULT f_mkdir (const char*); /* Create a new directory */
extern FRESULT f_chmod (const char*, BYTE, BYTE); /* Change file/dir attriburte */
extern FRESULT f_rename (const char*, const char*); /* Rename/Move a file or directory */
extern FRESULT f_mkfs (BYTE, BYTE, BYTE); /* Create a file system on the drive */


/* User defined function to give a current time to fatfs module */

extern DWORD get_fattime (void); /* 31-25: Year(0-127 org.1980), 24-21: Month(1-12), 20-16: Day(1-31) */
/* 15-11: Hour(0-23), 10-5: Minute(0-59), 4-0: Second(0-29 *2) */

#ifdef __cplusplus
}
#endif
Reply to this