以下:如何在 iOS 版 Monotouch 中使用 SQLite 中的 FTS
我目前正在关注这个关于 MonoTouch、SQLite 和 FTS3 的小教程: 如何通过 Monotouch 在 SQLite 中使用 FTS
我已经成功完成了步骤 1 和 2。不幸的是,我在步骤 3 中遇到了问题,因为当我尝试编译 iPhone monotocuh 项目时,出现以下错误:
错误 1:mtouch 失败,并显示以下消息:进程已退出 代码1,命令: /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 -arch i386 -gdwarf-2 -fobjc-legacy-dispatch -fobjc-abi-version=2 -miphoneos-版本-min=4.2 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2.sdk /var/folders/lu/luWKJVufEMO0MYd3+T3MJ++++TI/-Tmp-/tmp4f24ee90.tmp/main.x86.o -o /var/folders/lu/luWKJVufEMO0MYd3+T3MJ++++TI/-Tmp-/tmp4f24ee90.tmp/Iusuite -framework CFNetwork -framework AssetsLibrary -framework CoreTelephony -framework EventKit -framework Foundation -framework CoreMotion -framework GameKit -framework MapKit -framework MediaPlayer -framework MessageUI -framework OpenGLES -framework StoreKit -framework UIKit -framework AddressBookUI -framework iAd -framework SystemConfiguration -framework AddressBook -framework AudioToolbox -framework AVFoundation -framework QuartzCore -framework CoreFoundation -framework CoreGraphics-框架CoreLocation-框架ImageIO-框架 安全-框架 CoreMedia-框架 CoreVideo-框架 外部附件 -framework EventKitUI -framework QuickLook -framework AudioToolbox -lz -u _mono_pmip -u _CreateZStream -u _CloseZStream -u _Flush -u _ReadZStream -u _WriteZStream -liconv -lmono-2.0 -lmonotouch -L/Developer/MonoTouch/SDKs/MonoTouch.iphonesimulator.sdk/usr/lib -u _catch_exception_raise -L/用户/用户/开发/MonoDevelop/.../ -lSQLite3_iOS -force_load /Users/user/Develop/MonoDevelop/.../Libraries/libSQLite3_iOS.a
ld:找不到 -lSQLite3_iOS 的库collect2:ld 返回 1 退出 状态(1)(Iusuite.Application)
这是我用作单触摸的附加命令
-gcc_flags "-L${ProjectDir} -lSQLite3_iOS -force_load ${ProjectDir}/Libraries/libSQLite3_iOS.a"
有什么提示或想法吗?
感谢大家 弗朗西斯科
I'm currently following this small tutorial about MonoTouch, SQLite and FTS3:
How to use FTS in SQLite with Monotouch
I've sucessfully done step 1 and 2. Unfurtunatelly I'm facing a problem on step 3, because when i try to compile the iPhone monotocuh project I got this error:
Error 1: mtouch failed with the following message: Process exited with
code 1, command:
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2
-arch i386 -gdwarf-2 -fobjc-legacy-dispatch -fobjc-abi-version=2
-miphoneos-version-min=4.2 -isysroot
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2.sdk
/var/folders/lu/luWKJVufEMO0MYd3+T3MJ++++TI/-Tmp-/tmp4f24ee90.tmp/main.x86.o
-o
/var/folders/lu/luWKJVufEMO0MYd3+T3MJ++++TI/-Tmp-/tmp4f24ee90.tmp/Iusuite
-framework CFNetwork -framework AssetsLibrary -framework CoreTelephony
-framework EventKit -framework Foundation -framework CoreMotion
-framework GameKit -framework MapKit -framework MediaPlayer -framework
MessageUI -framework OpenGLES -framework StoreKit -framework UIKit
-framework AddressBookUI -framework iAd -framework SystemConfiguration
-framework AddressBook -framework AudioToolbox -framework AVFoundation
-framework QuartzCore -framework CoreFoundation -framework
CoreGraphics -framework CoreLocation -framework ImageIO -framework
Security -framework CoreMedia -framework CoreVideo -framework
ExternalAccessory -framework EventKitUI -framework QuickLook
-framework AudioToolbox -lz -u _mono_pmip -u _CreateZStream -u
_CloseZStream -u _Flush -u _ReadZStream -u _WriteZStream -liconv
-lmono-2.0 -lmonotouch
-L/Developer/MonoTouch/SDKs/MonoTouch.iphonesimulator.sdk/usr/lib -u
_catch_exception_raise
-L/Users/user/Develop/MonoDevelop/.../
-lSQLite3_iOS -force_load
/Users/user/Develop/MonoDevelop/.../Libraries/libSQLite3_iOS.ald: library not found for -lSQLite3_iOS collect2: ld returned 1 exit
status (1) (Iusuite.Application)
This is what i use as additional command for monotouch
-gcc_flags "-L${ProjectDir} -lSQLite3_iOS -force_load ${ProjectDir}/Libraries/libSQLite3_iOS.a"
Any hint or idea?
thanks to all
Francesco
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您正在构建自己的 sqlite 库,并且需要确保在 MonoTouch 项目中使用该库。
您提供给 mtouch 的额外参数要求 gcc 链接您的新库。给定的路径是:
/Users/francesco/Develop/MonoDevelop/AdMaiora/Applications/src/AdMaiora.Iusuite/Iusuite.App.Apple/Iusuite.Application/Libraries/libSQLite3_iOS.a
您的系统上是否存在该文件?如果没有,则查找该文件并更新您的额外参数或将库移动到您提供的位置。
注意:提供 -L${ProjectDir} 然后指定 -force_load ${ProjectDir}/Libraries/libSQLite3_iOS.a 的情况并不常见(注意额外的 /Libraries / 在路径中)。
You're building your own sqlite library and you need to make sure you're using this library from your MonoTouch project.
The extra arguments you're giving mtouch ask gcc to link your new library. The given path is:
/Users/francesco/Develop/MonoDevelop/AdMaiora/Applications/src/AdMaiora.Iusuite/Iusuite.App.Apple/Iusuite.Application/Libraries/libSQLite3_iOS.a
Does that file exists on your system ? If not then look for the file and either update your extra arguments or move the library to the location you provided.
Note: it's uncommon to provide -L${ProjectDir} and then specify -force_load ${ProjectDir}/Libraries/libSQLite3_iOS.a (note the extra /Libraries/ in the path).