SD Card File System, Offline Compilation

26 Mar 2011

Hi Simon, i am having trouble getting the SD Card library to compile with KEIL. Here is the list of errors. I have included FatFileSystem.ar in the linker. I have put all the header files and cpp files in the mbed folder. I still cannot figure out, why is cannot compile.

<<quote>> Build target 'mbed NXP LPC1768' compiling sd_datalogger.c... .\mbed\FileHandle.h(19): error: #20: identifier "namespace" is undefined .\mbed\FileHandle.h(19): error: #65: expected a ";" .\mbed\FileHandle.h(45): warning: #12-D: parsing restarts here after previous syntax error .\mbed\FileHandle.h(53): error: #77-D: this declaration has no storage class or type specifier .\mbed\FileHandle.h(53): error: #65: expected a ";" .\mbed\FileHandle.h(65): error: #757: variable "virtual" is not a type name .\mbed\FileHandle.h(65): error: #101: "ssize_t" has already been declared in the current scope .\mbed\FileHandle.h(65): error: #65: expected a ";" .\mbed\FileHandle.h(75): error: #77-D: this declaration has no storage class or type specifier .\mbed\FileHandle.h(75): error: #65: expected a ";" .\mbed\FileHandle.h(88): error: #757: variable "virtual" is not a type name .\mbed\FileHandle.h(88): error: #101: "off_t" has already been declared in the current scope .\mbed\FileHandle.h(88): error: #65: expected a ";" .\mbed\FileHandle.h(97): error: #77-D: this declaration has no storage class or type specifier .\mbed\FileHandle.h(97): error: #65: expected a ";" .\mbed\FileHandle.h(99): error: #757: variable "virtual" is not a type name .\mbed\FileHandle.h(99): error: #65: expected a ";" .\mbed\FileHandle.h(110): warning: #12-D: parsing restarts here after previous syntax error .\mbed\FileHandle.h(112): error: #169: expected a declaration .\mbed\DirHandle.h(19): warning: #12-D: parsing restarts here after previous syntax error .\mbed\DirHandle.h(21): error: #20: identifier "namespace" is undefined .\mbed\DirHandle.h(21): error: #65: expected a ";" .\mbed\DirHandle.h(46): warning: #12-D: parsing restarts here after previous syntax error .\mbed\DirHandle.h(57): error: #77-D: this declaration has no storage class or type specifier .\mbed\DirHandle.h(57): error: #65: expected a ";" .\mbed\DirHandle.h(62): error: #77-D: this declaration has no storage class or type specifier .\mbed\DirHandle.h(62): error: #65: expected a ";" .\mbed\DirHandle.h(70): error: #757: variable "virtual" is not a type name .\mbed\DirHandle.h(70): error: #65: expected a ";" .\mbed\DirHandle.h(81): warning: #12-D: parsing restarts here after previous syntax error .\mbed\DirHandle.h(83): error: #169: expected a declaration .\mbed\DirHandle.h(87): error: #40: expected an identifier .\mbed\DirHandle.h(87): error: #65: expected a ";" .\mbed\DirHandle.h(95): warning: #12-D: parsing restarts here after previous syntax error .\mbed\Base.h(15): error: #20: identifier "namespace" is undefined .\mbed\Base.h(15): error: #65: expected a ";" Target not created <</quote>>

26 Mar 2011

A number of these errors are caused by the fact that you are including a header file which contains C++ code into a C source file. If you rename your source file to be sd_datalogger.cpp then most build system will assume that you are building C++ code instead and then you shouldn't get these errors?