Zbar SDK - missing required architecture x86_64
Asked Answered
L

6

9

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

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)

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

Lewison answered 26/3, 2014 at 12:0 Comment(4)
It appears that the version of Zbar you downloaded does not support 64, which is required. You can try and build Zbar from source.Teuton
Yep, I did it, I have rebuild libzbar.a based on source with proper architectures. However It does not help me, is anybody whom it works?Lewison
did u add all required frameworks???Arvy
try this https://mcmap.net/q/1169661/-zbar-with-ios7-and-xcode5-compiling-error-libzbar-a-architectureContrarily
D
27

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.

Let me know if it works for you.

Darmstadt answered 7/1, 2015 at 22:28 Comment(1)
L
12

Recompile ZBar for iphone 6

Steps

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

Open Terminal and run following commands

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

b. cd zbar

c. hg checkout iPhoneSDK-1.3.1

d. open iphone/zbar.xcodeproj

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

Go to Build Settings set following Architectures

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

b. Valid Architectures -> arm64,armv7 armv7s

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

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

In My Case : /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

using xcode command line tools build your universal lib:

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.

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

Lockman answered 30/9, 2014 at 12:26 Comment(0)
A
5

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

armv7 armv7s arm64 i386 x86_64

You can test this using following command:

xcrun -sdk iphoneos lipo -info libzbar.a
Asocial answered 26/3, 2014 at 14:52 Comment(2)
I can't get that. I can get one with arv7 arv7s arm64. And another with armv7 i386 or armv7 x86_64 I don't know why. Can you help me?Bakemeier
Same happening for me. Can you help me how to get it build with x86_64?Lockman
U
5

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

the 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.

Unpracticed answered 9/1, 2015 at 14:21 Comment(0)
D
3

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

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.

Let me know if it works for you.

Dziggetai answered 26/3, 2014 at 14:44 Comment(2)
Hi, Can you please let me know how to compile libzbar for x86_64 with xcode 6? I am building with iOS Device but it gives only armv7 and arm64, and same for iPhone6 Simulator. Please let me know what I can do to get it build for x86_64 architecture.Lockman
Tushar - you need to generate a fat static library. gist.github.com/rehos/7856163Dziggetai
N
2

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:

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

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

Natalia answered 1/10, 2014 at 18:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.