Topic locked

Apple Mach-O Linker Error - When Building iOS Samples

August 24, 2014 - 7:46pm #1

Greetings,

After downloading the Sample files, and following instructions on how and where to set them up, I am now stuck receiving the following error when trying to Build and Run:

Apple Mach-O Linker Error

 

Ld /Users/IXL/Library/Developer/Xcode/DerivedData/VuforiaSamples-dybtsmmsbnthvyggsxzeqoanciww/Build/Products/Debug-iphoneos/Vuforia.app/Vuforia normal arm64
    cd /Users/IXL/Library/Developer/Vuforia_3_0/vuforia-sdk-ios-3-0-9/samples/VuforiaSamples
    export IPHONEOS_DEPLOYMENT_TARGET=7.0
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk -L/Users/IXL/Library/Developer/Xcode/DerivedData/VuforiaSamples-dybtsmmsbnthvyggsxzeqoanciww/Build/Products/Debug-iphoneos -Lbuild/lib -F/Users/IXL/Library/Developer/Xcode/DerivedData/VuforiaSamples-dybtsmmsbnthvyggsxzeqoanciww/Build/Products/Debug-iphoneos -filelist /Users/IXL/Library/Developer/Xcode/DerivedData/VuforiaSamples-dybtsmmsbnthvyggsxzeqoanciww/Build/Intermediates/VuforiaSamples.build/Debug-iphoneos/VuforiaSamples.build/Objects-normal/arm64/Vuforia.LinkFileList -dead_strip -fobjc-link-runtime -miphoneos-version-min=7.0 -framework GLKit -framework OpenGLES -lz -framework CoreVideo -framework CoreMedia -framework AVFoundation -framework SystemConfiguration -framework CoreMotion -framework Security -framework QuartzCore -framework UIKit -framework Foundation -framework CoreGraphics -lVuforia -Xlinker -dependency_info -Xlinker /Users/IXL/Library/Developer/Xcode/DerivedData/VuforiaSamples-dybtsmmsbnthvyggsxzeqoanciww/Build/Intermediates/VuforiaSamples.build/Debug-iphoneos/VuforiaSamples.build/Objects-normal/arm64/Vuforia_dependency_info.dat -o /Users/IXL/Library/Developer/Xcode/DerivedData/VuforiaSamples-dybtsmmsbnthvyggsxzeqoanciww/Build/Products/Debug-iphoneos/Vuforia.app/Vuforia

ld: library not found for -lVuforia
clang: error: linker command failed with exit code 1 (use -v to see invocation)

 

Have anything of you guys run into/solved this issue?

 

Thanks!

 

FYI: Xcode 5.1.1 - Vuforia SDK 3.0 - iPhone 5S - Yosemite OS

Apple Mach-O Linker Error - When Building iOS Samples

March 12, 2015 - 2:31am #38

@test4slk: your screenshot shows (1) a simple C++ programming error, and (2) that you are using an old API (e.g. Vuforia 2.0  or 2.8) and (3), it is not related to the original topic of this thread (Apple Mach-O Linker error in Unity).

Concerning the original "Linker" error issue, this is solved in Vuforia 4.0 (which supports Unity 4.5 and 4.6).

 

Apple Mach-O Linker Error - When Building iOS Samples

March 12, 2015 - 2:13am #37

Please solve this error...

Apple Mach-O Linker Error - When Building iOS Samples

September 29, 2014 - 12:47am #36
Hello again, I was all the information very useful and I managed to solve all the problems under which you attached. 
I think the screen is black or this error, how could fix it? 
Thanks again.

Apple Mach-O Linker Error - When Building iOS Samples

September 26, 2014 - 11:37am #35

OK, so, if you are not on iOS8, then things should work without issues;

in fact, on ioS 7.1.2 the only known issue is the one documented here for Unity 4.5.4:

https://developer.vuforia.com/forum/unity-3-extension-technical-discussion/unity-454-and-vuforia-ios

I can only add that 
I've made one more extra check by following the instructions in the Getting Started guide, and: 
- re-installing Unity 4.5.4
- re-installing Xcode 6
- re-downloading the Vuforia samples 3.0.10
- creating a fresh new Unity 4.5.4 project
- importing the Vuforia Image Target sample package (via Menu -> Assets -> Import package...) 
- building and running the project on an iPad 2 with iOS 7.1.2
 
I tried this on both a Macbook Air and a Mac Mini, both with Maverick OSX 10.9.5 (same as you).
The project compiles and runs fine (the only thing I had to fix is the Unity 4.5.4 issue mentioned above, i.e. add the UIInterfaceOrientation string into the Info.plist file).
 
 
 

Apple Mach-O Linker Error - When Building iOS Samples

September 26, 2014 - 9:02am #34

I updated my tablet to 7.1.2, does not have that option.

Apple Mach-O Linker Error - When Building iOS Samples

September 26, 2014 - 8:59am #33

Have you allowed the camera access ? iOS8 will ask you if you allow the app to get camera access the very first time you run the app;

if you hve accidentally "denied" camera access, go to your device  Settings > Privacy > Camera > your Vuforia appname  and enable the camera access.

See also here (again):

https://developer.vuforia.com/forum/ios/ios-8-xcode-6-and-vuforia-30-compatibility

 

Apple Mach-O Linker Error - When Building iOS Samples

September 26, 2014 - 8:53am #32

Exactly, but running with black screen.

Apple Mach-O Linker Error - When Building iOS Samples

September 26, 2014 - 8:51am #31

I only see a list of Warnings (but no "errors") in your screenshot; those warnings should not prevent you from running the app on your device.

 

Apple Mach-O Linker Error - When Building iOS Samples

September 26, 2014 - 8:13am #30

I've changed and continues to give this error

Apple Mach-O Linker Error - When Building iOS Samples

September 26, 2014 - 7:40am #29

All right. I see the mistake in the screenshot:

just replace this line: 

<string>UIInterfaceOrientationXYZ</string>

with this:

<string>UIInterfaceOrientationPortrait</string>

 

The 'XYZ' part is just a placeholder for the actual value, which is one of the following:

  • UIInterfaceOrientationPortrait
  • UIInterfaceOrientationLandscapeLeft
  • UIInterfaceOrientationLandscapeRight
  • UIInterfaceOrientationPortraitUpsideDown

 

 

Apple Mach-O Linker Error - When Building iOS Samples

September 26, 2014 - 7:34am #28

I already did,? There is this code?

Apple Mach-O Linker Error - When Building iOS Samples

September 26, 2014 - 6:43am #27

the EXC_BAD_ACCESS crash is expected n Unity 4.5.4, to fix this you can  go back to this article and follow the instructions:

https://developer.vuforia.com/forum/unity-3-extension-technical-discussion/unity-454-and-vuforia-ios

 

Apple Mach-O Linker Error - When Building iOS Samples

September 26, 2014 - 6:16am #26

Great, is fixed one thing, now I get this error ...

Apple Mach-O Linker Error - When Building iOS Samples

September 26, 2014 - 5:43am #25

Ok, the link errors indicate that something is wrong in the Xcode project settings:

try checking all of the following:

(this is the complete list of settings that you need to check, in addition to the architectures and valid architectures items mentioned previously)

Under the Build Phases tab:
Make sure to add the following libraries in Link Binary with Libraries:
  • CoreGraphics.framework
  • CoreMedia.framework
  • AVFoundation.framework
  • SystemConfiguration.framework
  • CoreMotion.framework
  • CoreVideo.framework
  • QuartzCore.framework
  • OpenGLES.framework
  • Security.framework
  • Foundation.framework
  • UIKit.framework
  • libVuforia.a
 
Under the Build Settings tab:
  • go to the Apple LLVM 6.0 - Language - C++ subcategory
  • change the "C++ Standard Library" property to one of:
    • libsdtc++ (GNU C++ standard library)  OR
    • Compiler Default
  • NOTE: it is also possible to leave the "C++ Standard Library" value set to the "libc++ Standard Library for C++ 11"; however, if you need to link such library, then:
    • under "Other Linker Flags" put the path of the libstdc++ library.  
    • For example on iOS SDK 7.1 this would be something like: /Applications/Xcode_511.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/usr/lib/libstdc++.dylib
 
Try this and let me know whether it resokved the linker errors.
Again under the Build Settings tab:
  • go to the Search Paths subcategory:
  • Header Search Path: add the path to the Vuforia headers, located in '/build/include' under your Vuforia installation directory
  • Library Search Path: add the path to the Vuforia libraries, located in '/build/lib/arm' under your Vuforia installation directory
 
 
ARC:
certain Vuforia sample source code files do not make use of ARC (Automatic Reference Counting); 
if ARC is globally enabled in your project, you can selectively disable it for specific source files (.mm files) by going to the Build Phases tab, under Compile Sources subcategory and add the following compiler flag next to each listed file for which you want ARC to be OFF:
   -fno-objc-arc
 
 
Device:
Make sure to build and run Vuforia on a real iOS device, which must be connected to your Mac via USB, as Vuforia does not support the XCode simulator (selecting an emulated device will result in build and/pr link errors).
 
 
 

Apple Mach-O Linker Error - When Building iOS Samples

September 26, 2014 - 5:35am #24

these errors are now

 

Apple Mach-O Linker Error - When Building iOS Samples

September 26, 2014 - 4:57am #23

If you go to the Xcode Build Settings of your target, what do you see under:

Architectures:

  • Architectures:
  • Valid Architectures:

?

if you see arm64, you should remove it.

 

 

Apple Mach-O Linker Error - When Building iOS Samples

September 26, 2014 - 4:46am #22

This is error that, please find attached image.

Apple Mach-O Linker Error - When Building iOS Samples

September 26, 2014 - 4:41am #21

Ok, if you are on Unity 4.5.4, then the error that you are seeing now is probably no longer the one that you originally posted in your first screenshot (which was a Mac link error, and which was due to using an old version of Unity i.e. 4.5.1);

presumably, now you should be facing a different error message, which is described here (with solution):

https://developer.vuforia.com/forum/unity-3-extension-technical-discussion/unity-454-and-vuforia-ios

correct ?

 

if not, please post an updated screenshot of the error you see...

 

Apple Mach-O Linker Error - When Building iOS Samples

September 26, 2014 - 4:35am #20
I upgraded to Unity 4.5.4 
Problem with this a release?

Apple Mach-O Linker Error - When Building iOS Samples

September 26, 2014 - 4:32am #19

That specific part  only applies to the sample code in the native samples (not Unity), so you can skip it.

Are you using Unity 4.5.3 / 4.5.4 (in one of your previous post you were mentioning Unity 4.5.1, but AFAIK that version does not fully support Build & Run with Xcode 6 and iOS 8...)

?

 

Apple Mach-O Linker Error - When Building iOS Samples

September 26, 2014 - 4:21am #18

I asked about this issue, I can not find where to modify this file, no where to be found.

 

OpenGL – Sample compiling errors

In order to compile and run the Vuforia Samples 3.0 in XCode 6 with the iOS 8 SDK, you will need to make a small adjustment of the code in the SampleApplicationShaderUtils.m source file, by adding the following import statement:

1
#import <OpenGLES/ES2/glext.h>
 

 

Apple Mach-O Linker Error - When Building iOS Samples

September 26, 2014 - 4:13am #17

So, are you sure you followed exactly and "verbatim" all the instructions provided in both these links:

https://developer.vuforia.com/forum/ios/ios-8-xcode-6-and-vuforia-30-compatibility

and

https://developer.vuforia.com/forum/unity-3-extension-technical-discussion/unity-454-and-vuforia-ios

Each of the articles above addresses specific error conditions and issues that you may encounter.

 

Apple Mach-O Linker Error - When Building iOS Samples

September 26, 2014 - 4:09am #16
Hi, does not work, do not know what else I can do, will be for the operating system Maverick ?, I deleted the preferences of Xcode, Unity3d updated to version 4.5, and I've re-downloaded the package Vuforia. 
You could tell me the settings in Xcode, you have to change a parameter, and unity, you have to configure something ?, not understand how it can not work. With simple applications without Vuforia working properly.

Apple Mach-O Linker Error - When Building iOS Samples

September 25, 2014 - 5:29am #15

Sorry but cannot send software packages via email :-)

What you can do is to download and reintall Unity, Xcode, and Vuforia, following the instructions on the Getting Started guide:

https://developer.vuforia.com/resources/dev-guide/getting-started-unity-extension

https://developer.vuforia.com/resources/dev-guide/getting-started-ios-native-sdk

https://developer.vuforia.com/resources/sample-apps/features

 

Apple Mach-O Linker Error - When Building iOS Samples

September 25, 2014 - 12:54am #14
Greetings again, it could be to send me the compilation of Unity to open it on my x-code, and thus discard it and Vuforia UNITY problem? 
my email: 

Apple Mach-O Linker Error - When Building iOS Samples

September 24, 2014 - 9:56am #13

Hi maiquel,

 

I've just tried building and running the Virtual Buttons sample as well as a few other samples (version 3.0.10) on the following setups:

  • - Unity 4.5.4
  • - Xcode 6 with iOS 8.0 SDK
  • - Mac Mini with OSX 10.9.5
  • - Bundle ID (in Player Settings): com.qualcomm.vuforia.samples (but here you can put whatever you like)

I tested it on an iPad on iOS 7.1.2 and and iPhone 5S on iOS 8.0

and in both cases it worked flawlessly (the only issue being the one described here:

https://developer.vuforia.com/forum/unity-3-extension-technical-discussion/unity-454-and-vuforia-ios

but this is not related to the issue you are seeing)

and the result is that all samples are buildng and running fine

(as also confirmed previously by dm3d)

 

Perhaps something wrong in your Unity installation or Xcode / iOS setup ? 

 

Apple Mach-O Linker Error - When Building iOS Samples

September 24, 2014 - 7:52am #12
Hello again and sorry for insisting, I updated my Ipad to version 7.1.2, I have proven with Virtual Buttons, and still gives the same problem. 
Some settings in Unity3d? or it is due?

Apple Mach-O Linker Error - When Building iOS Samples

September 24, 2014 - 2:47am #11

I have IOS 8 and still giving the same problems with the previous version have not proven that the iPad gives me no option to revert to a previous version.

It could not be with IOS August?

Apple Mach-O Linker Error - When Building iOS Samples

September 23, 2014 - 5:10pm #10

For testing, I used the Virtual Buttons 3.0.10 sample app with Vuforia 3.0.9 and Unity 4.5.1f3.

Note: Support for using the "Build & Run" option with Xcode 6 was added in Unity 4.5.3. See the release notes for more info:

http://unity3d.com/unity/whats-new/unity-4.5.3

I used the "Build" option in Unity and then opened the .xcodeproj file manually from Xcode 6.0.1. I was able to compile the app successfully to a 7.1.2 device.

The "SampleApplicationUtils.h" appears in the native iOS sample projects, but not in the Unity-compiled Xcode project.

Could you try compiling one of the native iOS sample apps to your device and see if that works?

https://developer.vuforia.com/resources/sample-apps/features

Apple Mach-O Linker Error - When Building iOS Samples

September 23, 2014 - 11:02am #9

Xcode 6

iOS 8 ,

Unity 4.5.1f3,

OSX 10.9.5,

Vuforia 3_0_9

Apple Mach-O Linker Error - When Building iOS Samples

September 23, 2014 - 10:55am #8

What versions of these are you using?

Xcode, iOS, Unity, OSX, Vuforia

 

Apple Mach-O Linker Error - When Building iOS Samples

September 23, 2014 - 7:59am #7
no where to find this file "SampleApplicationUtils.h" 
Is there any setting in Unity to work only in 32-bit? 
 
Deputy Screenshot

Apple Mach-O Linker Error - When Building iOS Samples

September 22, 2014 - 4:01pm #6

Looks like you're trying to compile in 64-bit. Vuforia only supports 32-bit at this time. The following thread has more info on fixing the arm64 related errors:

https://developer.vuforia.com/forum/ios/ios-8-xcode-6-and-vuforia-30-compatibility

 

Apple Mach-O Linker Error - When Building iOS Samples

September 22, 2014 - 10:26am #5

I feel the same, someone has found the solution?

Apple Mach-O Linker Error - When Building iOS Samples

September 22, 2014 - 12:40am #4

Same error. You need to change system settings. Read more at website.

Apple Mach-O Linker Error - When Building iOS Samples

September 6, 2014 - 2:42pm #3

same error

Apple Mach-O Linker Error - When Building iOS Samples

August 27, 2014 - 9:39pm #2

It would seem from the error that the linker can't find the libVuforia.a library. Is the -lVuforia flag pointing to the right location? In the sample projects, the libVuforia.a is referenced with a relative path.

Topic locked