我正在尝试将 BarcodeScanner 插件(来自 )与 PhoneGap 一起使用。我已仔细按照自述文件中的步骤(包括 ZXing 自述文件中的步骤)进行操作,但仍然出现此错误:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_ZXingWidgetController", referenced from:
objc-class-ref in BarcodeScanner.o
"_OBJC_CLASS_$_QRCodeReader", referenced from:
objc-class-ref in BarcodeScanner.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
说明中唯一没有完全按计划进行的部分是:
- Locate the "ZXingWidget.xcodeproj" file under "
zxing/iphone/ZXingWidget/
". Drag ZXingWidget.xcodeproj and drop it onto the root of your Xcode project's "Groups and Files" sidebar. A dialog will appear -- make sure "Copy items" is unchecked and "Reference Type" is "Relative to Project" before clicking "Add". Alternatively you can right-click on you project navigator and select 'Add files to "MyProject"'
但是,当我将 .xcodeproj 拖到我的项目中时,我没有看到对话框 - 它只是显示为“嵌套”项目。如果我走另一条路并单击“将文件添加到“我的项目”,该对话框不会提供“相对于项目”的选项:
如有任何关于我哪里出错的建议,我将不胜感激。我对 xcode 不太熟悉(许多 PhoneGap 开发人员也是如此)
最佳答案
zxing iphone 自述文件中显然不起作用的步骤是第 2 步。这是告诉 Xcode 将您的应用程序链接到 zxing 小部件库的部分,而这正是链接器找不到的部分。尝试仔细检查一下。
关于ios - ZXing phonegap 插件的 XCode 构建错误 : Undefind symbols for architecture i386,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7782011/