xcode4 zxing : Undefined symbols for architecture i386

末鹿安然 提交于 2019-12-23 05:41:18

问题


I need to incorporate QR in my app, im using zxing,

the scan test works wonderfully, and when importing the widget after following all instructions, all goes fine, but

I have this errors when implementing the code for the widget and QRCodeReader

Undefined symbols for architecture i386: "_OBJC_CLASS_$_ZXingWidgetController", referenced from: objc-class-ref in AttendanceVC.o "_OBJC_CLASS_$_QRCodeReader", referenced from: objc-class-ref in AttendanceVC.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)

so how to fix this please?

edit: my Architectures on build settings is: i386 armv6 armv7

thanks a lot!


回答1:


Double check step 2 in the README. Under Link Binary with Libraries you must have libZXingWidget.a and it sounds like you don't.




回答2:


Check the Valid Architectures in the build settings. Check out these links.

Undefined symbols for architecture i386: _OBJC_CLASS_$_SKPSMTPMessage", referenced from: error

Undefined symbols for architecture i386

EDIT : Usually these type of linker errors occur due to the link issue in your compiler or link issue with your added frameworks or your libraries. check whether you are using a suitable compiler, check whether you have added all the required libraries and frameworks. Also check whether you have imported all the libraries and frameworks properly. Please check all these things too once. For guidance on this check the below links

http://forums.macrumors.com/showthread.php?t=956090

Apple Mach-O Linker Error when compiling for device

Linker error (only simulator) with own library after update to iPhone SDK 4.0

clang: error: linker command failed with exit code 1

Hope This Helps..




回答3:


I had the same issue and following configuration in "Build Settings" works for me.

C Language Dialect: GNU99 [-std=gnu99]
C++ Language Dialect: Compiler Default
C++ Standard Library: Compiler Default



来源:https://stackoverflow.com/questions/8893983/xcode4-zxing-undefined-symbols-for-architecture-i386

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!