模拟器和iOS编译中的libsqlite [英] 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:
在 Xcode Navigator 中,单击您的目标(最上面的条目)
in Xcode Navigator, click on your target (the upmost entry)
转到Build Phases
,然后Link Binary With Libraries
从位于 /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOSxx.sdk/usr/lib/
这篇关于模拟器和iOS编译中的libsqlite的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!