1

I'm integrating unity project to native ios project in c++. But I'm getting error

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

while building xcode project.

I'm using

  • xCode : 8.2.1
  • Unity : 5.6.1f1

Project Structure

Framework

Noopur Dabhi
  • 1,867
  • 25
  • 38
  • FYI : I followed this [https://the-nerd.be/2015/11/13/integrate-unity-5-in-a-native-ios-app-with-xcode-7/](https://the-nerd.be/2015/11/13/integrate-unity-5-in-a-native-ios-app-with-xcode-7/) for integration – Noopur Dabhi Jun 01 '17 at 05:41
  • Please try to remove framework/library and then add it again. Make sure when you are adding "copy items if needed" is checked.. And there might be an issue of hierarchy of libraries in project. Keep all at same place and same level of folders. – Dimple Shah Jun 01 '17 at 06:06
  • Structure is fine.. Now check build settings.. library search path.. $(SRCROOT)/Libraries – Dimple Shah Jun 01 '17 at 06:52
  • I have added this "$(SRCROOT)/../../LoadScene_unity_build/Libraries" in Library Search Paths. I also tried with removing "", but no luck... :( – Noopur Dabhi Jun 01 '17 at 06:55
  • Have you tried with deleting derived data? – Dimple Shah Jun 01 '17 at 11:35
  • Yes, I have tried – Noopur Dabhi Jun 01 '17 at 12:04
  • See [this](https://stackoverflow.com/questions/24050012/error-library-not-found-for). That might be helpful. – Programmer Jun 01 '17 at 14:32
  • I tried all answers of [this](https://stackoverflow.com/questions/24050012/error-library-not-found-for), but didn't work... :( – Noopur Dabhi Jun 07 '17 at 08:54

3 Answers3

2

It doesn't look like you have the "Vuforia" library included in your build. Under your Unity project, look for a file called Vuforia.framework. This file's inspector should have "iOS" marked in it, so it gets included in the generated Xcode project.

lysergic-acid
  • 19,570
  • 21
  • 109
  • 218
1

If you integrated a Unity scene using Vuforia, you should be able to see those libraries libVuforia.a and libVuforiaUnityPlayer.a at the path Demo/Vendor/Unity/Libraries/Plugins/iOS/

If you don't see those libraries you should try to integrate your Unity scene once again. If they're here, in Xcode go to Build Phases, then Link Binary With Libraries and make sure you have those above libraries as well as libiPhone.a (those are the libraries given by your Unity scene and you definitely need them), if not add them.

Also, I believe you followed a tutorial to integrate a normal Unity scene, however when you use Vuforia you need to make some other steps. For instance, you'll have to add the folder references of Data AND QCAR. I recommend you to try once again your integration with this tutorial which is more relevant to what you want to do.

I hope this will be useful to you and I wish you good luck in your integration.

Frobei
  • 49
  • 8
  • Everything (libraries you mentioned) is there in project... I will try [https://github.com/keyv/iOSUnityVuforiaGuide](https://github.com/keyv/iOSUnityVuforiaGuide) and let you know if facing the same thing... – Noopur Dabhi Jun 12 '17 at 13:43
0

Because your code cannot find libVuforia.a, which is library. You have to set "Library search path" at "Build Setting"

or use vuforia sdk 1. download vuforia sdk https://developer.vuforia.com/downloads/sdk 2. create or put your source code put in Sample folder in vuforia-sdk-ios-7-0-43

enter image description here

3.In your project Go to Target > Build Setting > Search Paths > Library Search Path. and Click +

../../build/lib/arm

4.In your project Go to Target > Build Setting > Search Paths > Header Search Path. and Click +

../../build/include

5.Run