xcode sqlite3 libsqlite.dylib
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5392649/
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
xcode sqlite3 libsqlite.dylib
提问by pauljean
I have an error in project, but I d'nt know were is the problem. this is my error after compilation.
我在项目中有一个错误,但我不知道是问题所在。这是我编译后的错误。
ld warning:
警告:
in /install/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.0.sdk/usr/lib/libsqlite3.dylib, file is not of required architecture
在 /install/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.0.sdk/usr/lib/libsqlite3.dylib 中,文件不是必需的架构
ld warning:
警告:
in /install/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.0.sdk/usr/lib/libsqlite3.0.dylib, file is not of required architecture Undefined symbols:"_sqlite3_open", referenced from: -[LiteSqlViewController openDB] in LiteSqlViewController.o "_sqlite3_close", referenced from: -[LiteSqlViewController openDB] in LiteSqlViewController.o
在/install/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.0.sdk/usr/lib/libsqlite3.0.dylib,文件不是必需的架构未定义符号:“_sqlite3_open”,引用自:-[LiteSqlViewController openDB ] in LiteSqlViewController.o "_sqlite3_close",引用自:-[LiteSqlViewController openDB] in LiteSqlViewController.o
ld:
编号:
symbol(s) not found collect2: ld returned 1 exit status _sqlite3_open", referenced from:-[LiteSqlViewController openDB] in LiteSqlViewController.o "_sqlite3_close", referenced from:-[LiteSqlViewController openDB] in LiteSqlViewController.o
未找到符号 collect2:ld 返回 1 退出状态 _sqlite3_open”,引用自:-[LiteSqlViewController openDB] in LiteSqlViewController.o “_sqlite3_close”,引用自:-[LiteSqlViewController openDB] in LiteSqlViewController.o
ld:
编号:
symbol(s) not found collect2: ld returned 1 exit status Build failed (2 errors)
未找到符号 collect2:ld 返回 1 个退出状态构建失败(2 个错误)
I use OSX 10.5.8 xcode 3.1.2 iphone simulator 2.2.1 Architecture PPC
我使用 OSX 10.5.8 xcode 3.1.2 iphone 模拟器 2.2.1 Architecture PPC
the result of command:
命令的结果:
file /usr/lib/libsqlite3.dylib : /usr/lib/libsqlite3.dylib: Mach-O universal binary with 4 architectures /usr/lib/libsqlite3.dylib (for architecture ppc7400): Mach-O dynamically linked shared library ppc /usr/lib/libsqlite3.dylib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 /usr/lib/libsqlite3.dylib (for architecture i386): Mach-O dynamically linked shared library i386 /usr/lib/libsqlite3.dylib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64.
文件 /usr/lib/libsqlite3.dylib : /usr/lib/libsqlite3.dylib: Mach-O 通用二进制文件,具有 4 种架构 /usr/lib/libsqlite3.dylib(用于架构 ppc7400):Mach-O 动态链接共享库 ppc / usr/lib/libsqlite3.dylib(对于体系结构ppc64):Mach-O 64位动态链接共享库ppc64 /usr/lib/libsqlite3.dylib(对于体系结构i386):Mach-O动态链接共享库i386 /usr/lib /libsqlite3.dylib(用于 x86_64 架构):Mach-O 64 位动态链接共享库 x86_64。
回答by Pascal
It doesn't seem to be too straightforward to use the iPhone Simulator on PPC Macs. Issue the command file
with the path in the first error you get (right after the first ld warning:). Check out this related question, maybe these steps help.
在 PPC Mac 上使用 iPhone Simulator 似乎并不太简单。file
在您得到的第一个错误中发出带有路径的命令(在第一个ld 警告之后:)。查看此相关问题,也许这些步骤会有所帮助。
Old answer:
旧答案:
Did you link libsqlite3.dylib
in your project?
你libsqlite3.dylib
在你的项目中链接了吗?
In Xcode 4 this can be done like shown in the screenshot: Press the plus sign and add libsqlite3.dylib. Afterwards, you can drag the library into the Linked Frameworks folder. (The screenshot shows a Mac OS X application, it's the same for iOS applications.)
在 Xcode 4 中,这可以像屏幕截图所示那样完成:按加号并添加libsqlite3.dylib。之后,您可以将库拖到 Linked Frameworks 文件夹中。(屏幕截图显示的是 Mac OS X 应用程序,iOS 应用程序也是如此。)
回答by wadesworld
Xcode 4 does not build PPC architecture (nor does it work for any OS prior to 10.6).
Xcode 4 不构建 PPC 架构(也不适用于 10.6 之前的任何操作系统)。
You'll need to make sure that your program and the libsqlite3.dylib library are built for the same architecture. I suspect the library is built for x86.
您需要确保您的程序和 libsqlite3.dylib 库是为相同的体系结构构建的。我怀疑该库是为 x86 构建的。
As others have said use the "file" command to determine what architectures a file was built for.
正如其他人所说,使用“文件”命令来确定文件是为什么架构构建的。