在 Xcode 4.3.2 & iPhone Simulator 5.1 下找不到 sqlite3 库
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10150100/
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
Can't find sqlite3 library under Xcode 4.3.2 & iPhone Simulator 5.1
提问by Bryan Hanson
I'm working on a project that uses sqlite3. When I build the project, I get an error on this statement sqlite3 _wordsClues;
the error is Unknown type name 'sqlite3'
so it seems the library can't be found. I have libsqlite3.0.dylib
linked in the build phase. There is another option there I could use called libsqlite3.dylib
but I haven't used it.
我正在开发一个使用 sqlite3 的项目。当我建立这个项目,我得到这个说法错误sqlite3 _wordsClues;
的错误是Unknown type name 'sqlite3'
如此看来库无法找到。我已经libsqlite3.0.dylib
在构建阶段进行了链接。我可以使用另一个选项调用,libsqlite3.dylib
但我还没有使用它。
In my pch I have had at various points <sqlite3.h>
"sqlite3.h"
and "/usr/include/sqlite3.h"
None of these combinations have worked (found by looking around on SO).
在我的PCH我已经在不同的点了<sqlite3.h>
"sqlite3.h"
和"/usr/include/sqlite3.h"
这些组合都没有工作(由环顾SO找到)。
Any suggestions? I must be missing something simple. Thanks.
有什么建议?我一定错过了一些简单的东西。谢谢。
回答by lnafziger
This page: http://klanguedoc.hubpages.com/hub/Tutorial-on-Creating-an-IOS-5-SQLite-Database-Application-IOS-5-SQLitehas a very good example with the exact steps.
这个页面:http: //klanguedoc.hubpages.com/hub/Tutorial-on-Creating-an-IOS-5-SQLite-Database-Application-IOS-5-SQLite有一个很好的例子,里面有确切的步骤。
Basically, you need to link against usr/lib/sqlite_3.0.lib
and #import <sqlite3.h>
基本上,您需要链接到usr/lib/sqlite_3.0.lib
和#import <sqlite3.h>