title: Metaio App in Unity3D not building from XCode
body: <p>I am trying to build an augmented reality app built in Unity3d using the Metaio Unity SDK.  The app uses a CAD model as a target upon which it augments stuff.  It looks for something like the reference CAD model in the real world and then latches onto that.  In XCode, I add, from Libraries, the metaiosdk file (not metaiosdk.framework) to the Link Binaries to Libraries section.  I also add the libxml2.dylib framework.  When I build, I fail with tons of errors.  The errors all claim that "directory not found for option '-L/..." for Metaio framework.  When I search "search paths" in Build Settings and delete them all (per <a href="https://stackoverflow.com/questions/9458739/ld-warning-directory-not-found-for-option">this</a> SO answer), I go down to only one error, saying that there is no Metaio Framework.  When I add the whole SDK folder to the project and redo the previous steps, including having to delete search paths for libraries and headers again, I then get an error saying that -liPhone-lib library was not found.  I reimport that library, following the instructions from <a href="http://helpdesk.metaio.com/questions/19112/metaio-sdk5-ios-unity" rel="nofollow noreferrer">this Metaio Helpdesk post</a>, at which point I then re-delete the search paths for libraries and headers (or else I get about 30 errors again).  Then when I build I get only one error, saying that "'Unity/GlesHelper.h' was not found."  I am at a loss, as Google turns up no results for "GlesHelper.h" (in this context).  What am I doing wrong?  Does the SDK need to be inside the Unity project and the Unity Project inside the folder of the XCode project?  Is it the opposite way around?  Do I need to import the example scenes and not just the scene I am using?  Thank you for the help!
  <img src="https://i.stack.imgur.com/pq2ZI.png" alt="enter image description here"></p>
  
  <p>EDIT: Here is an example of the erros I get before deleting the search Library Paths in Build Settings:</p>
  
  <blockquote>
    <p>d: warning: directory not found for option
    '-L"/Users/capture/Desktop/iMacXC2/Libraries"' Undefined symbols for
    architecture armv7:</p>
    
    <blockquote>
      <p>"_CIDetectorAccuracy", referenced from:
            __ZNWwTeFvdBdVkDNRXNPUfEgifAKsRnrNYugVMtgpHhPUMqd in metaiosdk(xhvKRhZZTIhPZZYtqieHqfH)   "_OBJC_CLASS_$_CIDetector",
      referenced from:
            objc-class-ref in metaiosdk(xhvKRhZZTIhPZZYtqieHqfH)   "_kSecReturnRef", referenced from:
            _darwinssl_connect_common in metaiosdk(libcurl_la-curl_darwinssl.o)   "_CIDetectorAccuracyLow",
      referenced from:
            __ZNWwTeFvdBdVkDNRXNPUfEgifAKsRnrNYugVMtgpHhPUMqd in metaiosdk(xhvKRhZZTIhPZZYtqieHqfH)   "_kSecMatchPolicy", referenced
      from:
            _darwinssl_connect_common in metaiosdk(libcurl_la-curl_darwinssl.o)   "_kSecMatchLimitOne",
      referenced from:
            _darwinssl_connect_common in metaiosdk(libcurl_la-curl_darwinssl.o)   "_kSecMatchLimit", referenced
      from:
            _darwinssl_connect_common in metaiosdk(libcurl_la-curl_darwinssl.o)   "_kSecClass", referenced
      from:
            _darwinssl_connect_common in metaiosdk(libcurl_la-curl_darwinssl.o)   "_SSLWrite", referenced from:
            _darwinssl_send in metaiosdk(libcurl_la-curl_darwinssl.o)   "_SSLGetBufferedReadSize", referenced from:
            _Curl_darwinssl_data_pending in metaiosdk(libcurl_la-curl_darwinssl.o)   "_kSecClassIdentity",
      referenced from:
            _darwinssl_connect_common in metaiosdk(libcurl_la-curl_darwinssl.o)   "_SSLClose", referenced from:
            _Curl_darwinssl_close in metaiosdk(libcurl_la-curl_darwinssl.o)   "_SSLSetSessionOption",
      referenced from:
            _darwinssl_connect_common in metaiosdk(libcurl_la-curl_darwinssl.o)<br>
      "_SSLGetNumberSupportedCiphers", referenced from:
            _darwinssl_connect_common in metaiosdk(libcurl_la-curl_darwinssl.o)   "_SSLCreateContext",
      referenced from:
            _darwinssl_connect_common in metaiosdk(libcurl_la-curl_darwinssl.o)   "_SSLSetProtocolVersionMax",
      referenced from:
            _darwinssl_connect_common in metaiosdk(libcurl_la-curl_darwinssl.o)   "_SecItemCopyMatching",
      referenced from:
            _darwinssl_connect_common in metaiosdk(libcurl_la-curl_darwinssl.o)<br>
      "_SSLGetNegotiatedProtocolVersion", referenced from:
            _darwinssl_connect_step2 in metaiosdk(libcurl_la-curl_darwinssl.o)   "_SSLSetProtocolVersionMin",
      referenced from:
            _darwinssl_connect_common in metaiosdk(libcurl_la-curl_darwinssl.o)   "_SSLGetSessionState",
      referenced from:
            _Curl_darwinssl_check_cxn in metaiosdk(libcurl_la-curl_darwinssl.o)   "_SSLSetEnabledCiphers",
      referenced from:
            _darwinssl_connect_common in metaiosdk(libcurl_la-curl_darwinssl.o)   "_SecPolicyCreateSSL",
      referenced from:
            _darwinssl_connect_common in metaiosdk(libcurl_la-curl_darwinssl.o)<br>
      "_SecIdentityCopyCertificate", referenced from:
            _darwinssl_connect_common in metaiosdk(libcurl_la-curl_darwinssl.o)   "_SSLSetPeerID", referenced
      from:
            _darwinssl_connect_common in metaiosdk(libcurl_la-curl_darwinssl.o)   "_SSLGetNegotiatedCipher",
      referenced from:
            _darwinssl_connect_step2 in metaiosdk(libcurl_la-curl_darwinssl.o)   "_SSLSetPeerDomainName",
      referenced from:
            _darwinssl_connect_common in metaiosdk(libcurl_la-curl_darwinssl.o)   "_SSLRead", referenced from:
            _darwinssl_recv in metaiosdk(libcurl_la-curl_darwinssl.o)   "_SSLSetIOFuncs", referenced from:
            _darwinssl_connect_common in metaiosdk(libcurl_la-curl_darwinssl.o)   "_SSLHandshake", referenced
      from:
            _darwinssl_connect_step2 in metaiosdk(libcurl_la-curl_darwinssl.o)   "_SSLCopyPeerTrust",
      referenced from:
            _darwinssl_connect_common in metaiosdk(libcurl_la-curl_darwinssl.o)   "_SSLGetSupportedCiphers",
      referenced from:
            _darwinssl_connect_common in metaiosdk(libcurl_la-curl_darwinssl.o)<br>
      "_SecCertificateCopySubjectSummary", referenced from:
            _darwinssl_connect_common in metaiosdk(libcurl_la-curl_darwinssl.o)   "_SSLSetConnection",
      referenced from:
            _darwinssl_connect_common in metaiosdk(libcurl_la-curl_darwinssl.o)   "_CIDetectorTypeFace",
      referenced from:
            __ZNWwTeFvdBdVkDNRXNPUfEgifAKsRnrNYugVMtgpHhPUMqd in metaiosdk(xhvKRhZZTIhPZZYtqieHqfH)   "_SSLSetCertificate", referenced
      from:
            _darwinssl_connect_common in metaiosdk(libcurl_la-curl_darwinssl.o)<br>
      "_SecTrustGetCertificateCount", referenced from:
            _darwinssl_connect_common in metaiosdk(libcurl_la-curl_darwinssl.o)<br>
      "_SecTrustGetCertificateAtIndex", referenced from:
            _darwinssl_connect_common in metaiosdk(libcurl_la-curl_darwinssl.o) ld: symbol(s) not found for
      architecture armv7 clang: error: linker command failed with exit code
      1 (use -v to see invocation)</p>
    </blockquote>
  </blockquote>
  
  <p>And then after I delete the Library Search Paths, I get this:</p>
  
  <blockquote>
    <p>Ld
    /Users/capture/Library/Developer/Xcode/DerivedData/Unity-iPhone-glogufgfblmcyzasljopkkqcjtso/Build/Products/iMac.app/iMac
    normal armv7
        cd /Users/capture/Desktop/iMacXC2
        export IPHONEOS_DEPLOYMENT_TARGET=7.1
        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 armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk
    -L/Users/capture/Library/Developer/Xcode/DerivedData/Unity-iPhone-glogufgfblmcyzasljopkkqcjtso/Build/Products
    -F/Users/capture/Library/Developer/Xcode/DerivedData/Unity-iPhone-glogufgfblmcyzasljopkkqcjtso/Build/Products
    -filelist /Users/capture/Library/Developer/Xcode/DerivedData/Unity-iPhone-glogufgfblmcyzasljopkkqcjtso/Build/Intermediates/Unity-iPhone.build/Debug-iphoneos/Unity-iPhone.build/Objects-normal/armv7/iMac.LinkFileList
    -dead_strip -weak_framework CoreMotion -weak-lSystem -stdlib=libstdc++ -fobjc-link-runtime -miphoneos-version-min=7.1 /Users/capture/Desktop/iMacXC2/Libraries/metaiosdk -lxml2 -framework
    Foundation -framework UIKit -framework OpenGLES -framework QuartzCore
    -framework OpenAL -liconv.2 -liPhone-lib -framework AudioToolbox -framework CFNetwork -framework MediaPlayer -framework CoreLocation -framework SystemConfiguration -weak_framework iAd -framework CoreMedia -framework CoreVideo -weak_framework AVFoundation -framework
    CoreGraphics -weak_framework CoreMotion -weak_framework GameKit
    -Xlinker -dependency_info -Xlinker /Users/capture/Library/Developer/Xcode/DerivedData/Unity-iPhone-glogufgfblmcyzasljopkkqcjtso/Build/Intermediates/Unity-iPhone.build/Debug-iphoneos/Unity-iPhone.build/Objects-normal/armv7/iMac_dependency_info.dat
    -o /Users/capture/Library/Developer/Xcode/DerivedData/Unity-iPhone-glogufgfblmcyzasljopkkqcjtso/Build/Products/iMac.app/iMac</p>
    
    <p>ld: library not found for -liPhone-lib clang: error: linker command
    failed with exit code 1 (use -v to see invocation)</p>
  </blockquote>
  
  <p>And after I re-import the missing library, I just continue on that pattern of get errors for Library Search Paths, have to reimport Library, repeat, over and over, until reaching the above image where I need Unity/GlesHelper.h, at which point I am at a loss.</p>