开发者

SQlite 3 error when compiling in iOS 5

开发者 https://www.devze.com 2023-04-12 19:35 出处:网络
I am experiencing the following error while compiling my code with iOS5.With previous version it seems fine

I am experiencing the following error while compiling my code with iOS5.With previous version it seems fine

/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/usr/include/sqlite3.h:230:24: error: redefinition of 'sqlite3' as di开发者_Go百科fferent kind of symbol [3]

any suggestions


I have the same problem. I discovered that when I change the "Compiler for C/C++/Objective-C" from "Apple LLVM compiler 3.0" back to "LLVM GCC 4.2" the error disappears. (but that's not the preferred iOS 5 setting)

Also it seems that sqlite3 is now included by default in iOS 5.0, which might cause the redefinition error when you included the sqlite3 as a framework in your project. But even when I removed the framework from my project, the error kept appearing (but only 2 instead of 4 this time).


I just had the same problem. My issue was that I had used a forward declaration in my header file. This conflicted with a line of code in sqlite3.h:

typedef struct sqlite3 sqlite3;

Rather than using forward declaration, simply use #import <sqlite3> in the header file to avoid this issue.

(I realize that this may not have been the problem in your case, Qamar, but I'm posting it for those future coders who encounter this bug)

0

精彩评论

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

关注公众号