libsqlite在模拟器和iOS编译 [英] libsqlite in simulator and iOS compiling
问题描述
编译我的应用程序到iOS时遇到一些问题。
我使用sqlite3并导入为
I'm having some issues when compiling my app to iOS. I'm using sqlite3 and imported as
#import <sqlite3.h>
好吧,我在Mac中找到一个名为libsqlite3.0.dylib的文件,我的项目。
当我为iOS模拟器编译它,它的工作正常。但是,当我尝试编译iOS设备的应用程序时,它在我执行sqlite函数(如_sqlite3_open等)的每个调用中抛出一个错误(Apple Match-O链接器错误)。
Well, I only found a file named libsqlite3.0.dylib in my Mac and I copied it to my project. When I compile it for iOS Simulator, it works just fine. However, when I try to compile the app for iOS Device, it throws an error (Apple Match-O Linker Error) in every call I do in my implementation to sqlite's function (such as _sqlite3_open, etc.)
如何编译到iOS设备?
How can I compile it to iOS Device?
谢谢!
推荐答案
而不是简单地复制库,这样做:
Instead of simply copying the library, do it like this:
-
导航器,点击您的目标(最上面的条目)
in Xcode Navigator, click on your target (the upmost entry)
转到构建阶段
c $ c>链接二进制与库
go to Build Phases
, then Link Binary With Libraries
添加libsqlite3.dylib从它的位置 / Developer /Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOSxx.sdk/usr/lib /
add the libsqlite3.dylib from it's location at /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOSxx.sdk/usr/lib/
这篇关于libsqlite在模拟器和iOS编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!