xcode Zbar SDK - 缺少所需的架构 x86_64

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22660361/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 04:48:59  来源:igfitidea点击:

Zbar SDK - missing required architecture x86_64

iosxcodezbar-sdkzbarxcode5.1

提问by mbutan

I had one problem during building application in the recent Xcode 5.1. Compilation fails with "Undefined symbols for architecture x86_64" error.

我在最近的 Xcode 5.1 中构建应用程序时遇到了一个问题。编译失败并显示“体系结构 x86_64 的未定义符号”错误。

I build my project with Valid Architecture: armv7, armv7s and arm64. After switch to the newest environment (Xcode) I rebuild libzbar.a library in the same architecture ( I have done it based on solution found at: Linker Error in Xcode-5)

我使用有效架构构建我的项目:armv7、armv7s 和 arm64。切换到最新环境 (Xcode) 后,我在同一架构中重建 libzbar.a 库(我已根据以下解决方案完成此操作:Linker Error in Xcode-5

Maybe somebody also had same problem and finally he had solved it, please share with solution:)

也许有人也有同样的问题,最后他已经解决了,请与解决方案分享:)

回答by fpauer

I had the same problem and I solved that way:

我遇到了同样的问题,我是这样解决的:

  • Remove the reference of folder ZBarSDK from your project.
  • Download the version for armv7, arm7s and armv64 from this link.
  • Replace the older folder for the new, (Save a copy in case )
  • Add the new folder into your project.
  • Clean the project and Build.
  • 从您的项目中删除文件夹 ZBarSDK 的引用。
  • 从此链接下载 armv7、arm7s 和 armv64 的版本。
  • 将旧文件夹替换为新文件夹(保存副本以防万一)
  • 将新文件夹添加到您的项目中。
  • 清理项目并构建。

Let me know if it works for you.

请让我知道这对你有没有用。

回答by Tushar - iOS developer

Recompile ZBar for iphone 6

为 iphone 6 重新编译 ZBar

Steps

脚步

Download the source code (you must have Mercurial for mac):

下载源代码(你必须有 Mac 版 Mercurial):

Open Terminal and run following commands

打开终端并运行以下命令

a. hg clone http://zbar.hg.sourceforge.net:8000/hgroot/zbar/zbar

一种。汞克隆http://zbar.hg.sourceforge.net:8000/hgroot/zbar/zbar

b. cd zbar

湾 cd zbar

c. hg checkout iPhoneSDK-1.3.1

C。汞结帐 iPhoneSDK-1.3.1

d. open iphone/zbar.xcodeproj

d. 打开 iphone/zbar.xcodeproj

In the xcode project edit the "libzbar" scheme and select Release in Build configuration

在 xcode 项目中编辑“libzbar”方案并在构建配置中选择发布

Go to Build Settings set following Architectures

转到遵循架构设置的构建设置

a. Architectures - >Standard architectures(armv7,armv72,arm64)

一种。架构 - >标准架构(armv7,armv72,arm64)

b. Valid Architectures -> arm64,armv7 armv7s

湾 有效架构 -> arm64,armv7 armv7s

Compile libzbar for device AND for simulator, here the configuration:

为设备和模拟器编译 libzbar,这里是配置:

Find the compiled libzbar.a and go in the folder using Teminal.app,

找到编译好的 libzbar.a 并使用 Teminal.app 进入文件夹,

In My Case : /Users/kappe/Library/Developer/Xcode/DerivedData/zbar-gyozyrpbqzvslmfoadhqkwskcesd/Build/Products

在我的情况下:/Users/kappe/Library/Developer/Xcode/DerivedData/zbar-gyozyrpbqzvslmfoadhqkwskcesd/Build/Products

In this folder you you should have two sub folder Release-iphoneos and Release-iphonesimulator

在这个文件夹中你应该有两个子文件夹 Release-iphoneos 和 Release-iphonesimulator

using xcode command line tools build your universal lib:

使用 xcode 命令行工具构建您的通用库:

lipo -create Release-iphoneos/libzbar.a Release-iphonesimulator/libzbar.a -o libzbar.a

lipo -create Release-iphoneos/libzbar.a Release-iphonesimulator/libzbar.a -o libzbar.a

Now you can use the libzbar.a created, both in device and simulator.

现在您可以在设备和模拟器中使用创建的 libzbar.a。

Ref: xcode 5.1 - Undefined symbols for architecture x86_64 (zbar)

参考:xcode 5.1 - 架构 x86_64 (zbar) 的未定义符号

回答by francesco berna

for me: xcode 6, iphone 6 works the fpauer's method!

对我来说:xcode 6,iphone 6 使用 fpauer 的方法!

the way:

道路:

Remove the reference of folder ZBarSDK from your project. Download the version for armv7, arm7s and armv64 from thislink . Replace the older folder for the new, (Save a copy in case ) Add the new folder into your project. Clean the project and Build.

从您的项目中删除文件夹 ZBarSDK 的引用。从下载版本的ARMv7,arm7s和armv64这个链接。将旧文件夹替换为新文件夹(保存副本以防万一)将新文件夹添加到您的项目中。清理项目并构建。

回答by gagarwal

Make sure your libzbar.a contains all the architectures you needed in your project. You may need following to build for device and simulator:

确保您的 libzbar.a 包含您项目中所需的所有架构。您可能需要以下内容来构建设备和模拟器:

armv7 armv7s arm64 i386 x86_64

You can test this using following command:

您可以使用以下命令对此进行测试:

xcrun -sdk iphoneos lipo -info libzbar.a

回答by HMHero

I had same problem yesterday and I was finally able to build with 64-bit simulator.

昨天我遇到了同样的问题,我终于能够使用 64 位模拟器进行构建。

After the link you tried, I replaced the library and all the header files. but it wasn't enough. Then I also unlink the libzbar.a from Link Binary With Libraries on Bulid Phases and re-add the library. Then it was working.

在您尝试链接后,我替换了库和所有头文件。但这还不够。然后我还取消了 libzbar.a 与 Link Binary With Libraries on Bulid Phases 的链接,并重新添加了该库。然后它开始工作了。

Let me know if it works for you.

请让我知道这对你有没有用。

回答by ColossalChris

I was on the ZBar train as well for quite a while dealing with these issues since they have not been updating the SDK. Luckily if your app only has to support iOS7 onwards (which most iOS users are on now!) there is now QR/Bar Code reading support in AVFoundation so you can build your own reader very easily. Check out this tutorial:

我在 ZBar 火车上也有一段时间处理这些问题,因为他们没有更新 SDK。幸运的是,如果您的应用程序只需要支持 iOS7 以后(大多数 iOS 用户现在都在使用!),现在 AVFoundation 中支持 QR/条形码阅读,因此您可以非常轻松地构建自己的阅读器。看看这个教程:

http://www.appcoda.com/qr-code-ios-programming-tutorial/

http://www.appcoda.com/qr-code-ios-programming-tutorial/

Then bask in the beauty that is a totally Apple supported QR Code reader!

然后享受完全 Apple 支持的 QR 码阅读器的美丽!