开发者

sqlite3 compile error with llvm compiler

Compiling my project on new xcode4 using llvm 2.0 compiler I get a strange error coming from standard <sqlite3.h> header. Problem is with the following line:

//<sqlite3.h>
typ开发者_运维技巧edef struct sqlite3 sqlite3;

Error message:

In file included from /Projects/trunk/MyProj/Classes/StatsProvider.m:14:
Elaborated type refers to a non-tag type in /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/usr/include/sqlite3.h

Using GCC 4.2 project compiles with no problem

How can I fix that error?


My guess: you are compiling sqlite as C++ code, whereas you should compile it as plain C code. class/struct keywords implicitly introduce a typedef in C++, but not so in C.


I interpret the error message as the compiler complaining about using struct sqlite3 when it hasn't seen a struct declaration with that name. Struct names are in a special "tag-space".

My next guess is that the new compiler is stricter than the old one, and has found a bug.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜