Xcode 8.1 Undefined symbols for architecture x86_64 Error - ios

Undefined symbols for architecture x86_64:
"_BROADCAST_MODE_IBEACON", referenced from:
-[MainViewController tableView:cellForRowAtIndexPath:] in MainViewController.o
"_OBJC_CLASS_$_TZBeaconSDK", referenced from:
objc-class-ref in MainViewController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I take that error when I want to use simulator. There is no problem when I build it on iPhone. There is only problem when I use simulator. I have tried to change Architectures from Build settings, error text changes as i386 but problem is same.
I use that sdk; TZBeacon
Is there any problem with sdk? Could you help me to solve that problem?

Your library does not support simulator. Run this command line to see which architecture that it supports:
lipo -info libTZBeaconSDK.a
the result is: Architectures in the fat file: libTZBeaconSDK.a are: armv7 arm64
So, you have to test in a device, not in simulator!

Typically you get that error in the simulator if the architecture of the framework is built for the device. You need to use a version of the framework that is built for the simulator to run it on the simulator. This is something that should be provided by the framework vendor.
If they don't provide one then look into only including that framework when building to the device and not to the simulator. There is another SO answer here to point you in the right direction: How to only include a framework when building for device, not iOS Simulator?

Simple trick here: Go -> Go To Folder "/Library/Developer/Xcode"
delete Derived data next clean your project then Run .

Related

undefined symbols:___ isplatformversionatleast

I have used pod "SinchRTC" and I am able to build and run the project in debug mode. But now when I am achieving the project, I am getting the error :--
Undefined symbols for architecture arm64:
"___isPlatformVersionAtLeast", referenced from:
-[RTCMTLRenderer setupTexturesForFrame:] in Sinch(libSinch-dist.a-arm64-master.o)
-[RTCMTLVideoView frameRotation] in Sinch(libSinch-dist.a-arm64-master.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Is this a framework issue because I am not getting any solutions?
I want to upload this build. Can you please provide me a solution for this.
Thanks in advance.
Make sure you have arm64 architecture turned on in your project's build settings. Also, if you are trying to use the same binary for both iPhone 5 and 6 (and others), make sure that and that 'Build for Active Architecture Only' is turned off.
Or
Try this
isPlatformVersionAtLeast are in iOS SDK 13, so would require Xcode 11 beta. I think you are getting the error because you are using an earlier Xcode version Xcode 10.3 .

Library not working on simulator

Hello I'm using a library in my project, and basically it's working on real devices, but not on simulator.
I would like to know how to add compatibility with simulator also.
I've search around, and I found some answers that should have solved my problem, but they're not doing it. (Maybe I'm doing things wrong, but still not working).
I'm getting this error:
Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_Library",
referenced from:
objc-class-ref in class.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code
1 (use -v to see invocation)
I tried it on xcode7 and xcode8.
Thanks.
Maybe you're using a framework or library which was only built for ARM architecture. In that case you'll have to create fat binary which will include code for all platforms (x86 for simulator, ARM and ARM64 for iOS devices).

xcode, launching on simulator is ok but cannot archive

I am new to Xcode.
I am adding some features on the old(iOS 3.2) xcode game project. This code never touched for more than a year until I touched.
It worked fine until I tried to make an .iap file. it ran ok and all my changes didn't make any error.
So I changed target device from iPhone 6.0 Simulator -> iOS Device, and tried archive. Unfortunately it generated bunch of errors:
ld: warning: ignoring file lib/libegn_neutron_http_Release_iphoneos.a, file was built for archive which is not the architecture being linked (armv7): lib/libegn_neutron_http_Release_iphoneos.a
Undefined symbols for architecture armv7:
"_EGN_setPollingInMenu", referenced from:
ExitGamesCreateSession(sLibraryData*) in exitgames.o
"_EGN_Neutron_New", referenced from:
ExitGamesInit(sLibraryData*) in exitgames.o
"_EGN_setServerUrl", referenced from:
ExitGamesCreateSession(sLibraryData*) in exitgames.o
......similar 34 errors continued
"_EGN_NeutronCls_Release", referenced from:
ExitGamesShutDown(sLibraryData*) in exitgames.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
This project uses some "exitgames" library which supports social features.
Also this project have some wrapping part of "Brew" c++ codes.
I don't know which part has the problem. tried to figure out and searched a whole day but still couldn't get a clue.
Can anybody give me an advice?
Thank you.
Try running lipo -info exitgames.a from the command line, it should tell you what architectures the framework is made to support.

iOS Static Library Xcode (linking errors)

I created a static library with Xcode I have compiled selecting a device.
I added this to my library test project in Xcode 4.6
but I always have 2 errors during the linking...
I followed this tutorial: Static Library iOS Tutorial
if I download the sample code I have the same errors:
ld: warning: ignoring file /Users/Downloads/ICodeBlogStaticLibrarySample/MathTest/Classes/iCodeBlogsMathLibrary/libICodeMathUtils.a, missing required architecture i386 in file /Users/Downloads/ICodeBlogStaticLibrarySample/MathTest/Classes/iCodeBlogsMathLibrary/libICodeMathUtils.a (2 slices)
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_MathFunctions", referenced from:
objc-class-ref in MathTestAppDelegate.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I had once made a static lirary , I had the same problem .
Solution was to "Run the app on device " not on simulator , it works fine then !!!
Hope this helps...
I followed this step by step tutorial:
Tutorial
in particular I had to add these flags: -ObjC and -all_load
You must have selected iOS simulator while building the project. Select iOS device and it should be fine.
Do read and try to understand the error message, it's a meaningful English phrase.
symbol(s) not found for architecture i386
So there's no compiled code for the i386 architecture in the library. This means that either it's compiled for ARM only (for actual iOS devices, like iPhone or iPad), or for the 64-bit simulator (x86_64). Use otool to find out the architectures present in the library.

Zebra printer code in iphone

Thanks for going through this. I successfully integrated Zebra Printer working in xcode and got the label printer successfully from simulator, but the problem raises the moment i tried to debug it on my device saying
"ld: warning: ignoring file /Users/MYSystem/Desktop/MYProject/libZSDK_API.a, file was built for archive which is not the architecture being linked (armv7)
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_ZebraPrinterFactory", referenced from:
objc-class-ref in MyViewController.o
"_OBJC_CLASS_$_TcpPrinterConnection", referenced from:
objc-class-ref in MyViewController.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)".
What would went wrong, please help me out from this..Thanks in advance
You need to include the library for the device, not the simulator. If you look at your install folder the lib folder has a Device and a Simulator directory. Link against the library in the Device directory.
The problem is the library is built for ios simulator which is using mac osx architecture which is i386 but ios device is based on ARM v6/v7 architecture that's why you are getting this error. Try to compile library for ios device.

Resources