Gomu
Gomu

Reputation: 1064

Syntax errors in WinCE C file

I'm using Visual Studio 2008. I'm working on AM335x WinCE7 BSP. I added a new library source code which involves header files from common folder. The issue I'm facing is that, when I compile that library code, I'm getting syntax error in a class in common folder header file. There is no possibility for syntax errors to occur in common codes. So, I doubt that some other issue might be causing this. I'm getting a warning regarding this, which I feel, leads to the error.

warning C4218: nonstandard extension used : must specify at least a storage class or a type

I used pragma to suppress the warning. But, though the warning was ignored, the error persists.

Please guide me regarding this as I don't have any idea about this. Also, if any other information is needed regarding this, please comment.

EDIT1:

Actually the code is huge. Please refer this link. I'm facing very similar issue. They have asked to add StdAfx.cpp and StdAfx.h files. But it is for VC++. So, I'm confused whether it conforms to wince C file also.

EDIT2:

I'm getting the following errors.

error C2061: syntax error : identifier 'CReg'
error C2059: syntax error : ';'
error C2449: found '{' at file scope (missing function header?)
error C2059: syntax error : '}'
error C2143: syntax error : missing '{' before '*'
warning C4431: missing type specifier - int assumed. Note: C no longer supports default-int
warning C4218: nonstandard extension used : must specify at least a storage class or a type


class CSDIOControllerBase   -> C2061,C2059
{                           -> C2449
 // some code

};                          -> C2059

CSDIOControllerBase *CreateSDIOController();    -> C2143

Upvotes: 0

Views: 328

Answers (1)

Clifford
Clifford

Reputation: 93476

The code you are trying to compile as C is in fact C++, and therefore requires C++ compilation. You cannot include a C++ header directly in code compiled as C.

If you need to use the features provided by this header, the chances are that you will need to use C++ in any case. So your own code will need to be C++ in nay case.

Upvotes: 1

Related Questions