SQLite3 在 xcode 4.3.2 中出错
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10419042/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
SQLite3 getting errors in xcode 4.3.2
提问by Bill
My Application was working perfectly on Snow Leopard with Xcode 4.2. Built with no errors and ran with the SQL database with no problem. I upgraded to Lion and Xcode 4.3.2 and when I Build, I get errors of "/usr/include/sqlite3.h file not found" on my #import "/usr/include/sqlite3.h" lines of code. Any one else have this problem or have any suggestions? I have tried deleting the libsqlite3.dylib from the Project Navigator, and then adding it back via the + sign in the Build Phases tab in the Link Binary With Libraries, but the error persists.
我的应用程序在使用 Xcode 4.2 的 Snow Leopard 上运行良好。没有错误地构建并使用 SQL 数据库运行没有问题。我升级到 Lion 和 Xcode 4.3.2,当我构建时,在我的 #import "/usr/include/sqlite3.h" 代码行中出现“/usr/include/sqlite3.h 文件未找到”错误。其他人有这个问题或有任何建议吗?我曾尝试从项目导航器中删除 libsqlite3.dylib,然后通过 Link Binary With Libraries 的 Build Phases 选项卡中的 + 符号将其添加回来,但错误仍然存在。
回答by DavidNg
When updating from Snow Leopard
to Lion
and Xcode 4.2
to Xcode 4.5
, your will got error: " '/usr/include/sqlite3.h' file not found".
当从Snow Leopard
toLion
和Xcode 4.2
to更新时Xcode 4.5
,你会得到错误:“'/usr/include/sqlite3.h' file not found”。
Solution:
解决方案:
Add library:
"libsqlite3.0.dylib"
in theTarget > Build Phases
Change
#import "/usr/include/sqlite3.h"
to#import "sqlite.h"
in your code
添加库:
"libsqlite3.0.dylib"
在Target > Build Phases
在您的代码中更改
#import "/usr/include/sqlite3.h"
为#import "sqlite.h"
Update to author's post:It is not #import "sqlite.h"
. It is: #import <sqlite3.h>
更新作者的帖子:它不是#import "sqlite.h"
。这是:#import <sqlite3.h>
回答by Caleb Jessie
I think what your problem is you need to include the SQLite 3.0 Framework into your project.
我认为您的问题是您需要将 SQLite 3.0 框架包含到您的项目中。
Refer to this question if you don't know how to add a framework: How to “add existing frameworks” in Xcode 4?
如果您不知道如何添加框架,请参阅此问题: 如何在 Xcode 4 中“添加现有框架”?
The framework you want is libsqlite3.0.dylib
你要的框架是libsqlite3.0.dylib
Hope this helps!
希望这可以帮助!