Debugging linker error with Xcode - sdl static library
<p>I am trying to follow this guide here for building SDL2 for iOS:</p>

<p><a href="http://lazyfoo.net/tutorials/SDL/52_hello_mobile/ios_mac/index.php" rel="nofollow noreferrer">http://lazyfoo.net/tutorials/SDL/52_hello_mobile/ios_mac/index.php</a></p>

<p>I am able to build the libSDL2.a static library, however I am getting a linker error when I attempt to build his example hello world application which uses it. </p>

<pre><code>Ld /Users/testuser/Library/Developer/Xcode/DerivedData/___PROJECTNAME___-egvszvnfjpicgqdtaazpczjuebut/Build/Products/Debug-iphonesimulator/___PROJECTNAME___.app/___PROJECTNAME___ normal x86_64
    cd "/Users/testuser/Documents/iosBuild/SDL iOS Application"
    export IPHONEOS_DEPLOYMENT_TARGET=10.0
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.0.sdk -L/Users/testuser/Library/Developer/Xcode/DerivedData/___PROJECTNAME___-egvszvnfjpicgqdtaazpczjuebut/Build/Products/Debug-iphonesimulator -F/Users/testuser/Library/Developer/Xcode/DerivedData/___PROJECTNAME___-egvszvnfjpicgqdtaazpczjuebut/Build/Products/Debug-iphonesimulator -filelist /Users/testuser/Library/Developer/Xcode/DerivedData/___PROJECTNAME___-egvszvnfjpicgqdtaazpczjuebut/Build/Intermediates/___PROJECTNAME___.build/Debug-iphonesimulator/___PROJECTNAME___.build/Objects-normal/x86_64/___PROJECTNAME___.LinkFileList -mios-simulator-version-min=10.0 -Xlinker -object_path_lto -Xlinker /Users/testuser/Library/Developer/Xcode/DerivedData/___PROJECTNAME___-egvszvnfjpicgqdtaazpczjuebut/Build/Intermediates/___PROJECTNAME___.build/Debug-iphonesimulator/___PROJECTNAME___.build/Objects-normal/x86_64/___PROJECTNAME____lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -lSDL2 -framework GameController -framework Foundation -framework UIKit -framework OpenGLES -framework QuartzCore -framework CoreAudio -framework AudioToolbox -framework CoreGraphics -framework CoreMotion -Xlinker -dependency_info -Xlinker /Users/testuser/Library/Developer/Xcode/DerivedData/___PROJECTNAME___-egvszvnfjpicgqdtaazpczjuebut/Build/Intermediates/___PROJECTNAME___.build/Debug-iphonesimulator/___PROJECTNAME___.build/Objects-normal/x86_64/___PROJECTNAME____dependency_info.dat -o /Users/testuser/Library/Developer/Xcode/DerivedData/___PROJECTNAME___-egvszvnfjpicgqdtaazpczjuebut/Build/Products/Debug-iphonesimulator/___PROJECTNAME___.app/___PROJECTNAME___

ld: library not found for -lSDL2
clang: error: linker command failed with exit code 1 (use -v to see invocation)
</code></pre>

<p>Per his instructions, I copied the project template and added the libSDL2.a lib that I built under the Build Phases -> link binary with libraries menu:</p>

<p><a href="https://i.stack.imgur.com/MyShN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MyShN.png" alt="enter image description here"></a></p>

<p>Any suggestions for how I can debug this problem?</p>

<p>Edit: My build target configuration in the project which uses the library:</p>

<p><a href="https://i.stack.imgur.com/ldknD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ldknD.png" alt="enter image description here"></a></p>

<p><a href="https://i.stack.imgur.com/b6gwW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/b6gwW.png" alt="enter image description here"></a></p>