Admob cocos2d-x 2.1.5 clang: error: linker command failed with exit code 1


#1

I added Admob following https://developers.google.com/mobile-ads-sdk/docs/#ios and getting error below in cocos2d-x 2.1.5. Can anyone shed some light on fixing this issue.

Ld /Users/kreal/Library/Developer/Xcode/DerivedData/ProjectX-dlwyuxydggdginfxxboolxhgtphc/Build/Products/Debug-iphonesimulator/ProjectX.app/ProjectX normal i386
    cd /Users/kreal/Desktop/Dropbox/iOS/cocos2d-x-2
    setenv IPHONEOS_DEPLOYMENT_TARGET 4.3
    setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.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 i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk -L/Users/kreal/Library/Developer/Xcode/DerivedData/ProjectX-dlwyuxydggdginfxxboolxhgtphc/Build/Products/Debug-iphonesimulator -L\"/Users/kreal/Desktop/Dropbox/iOS/cocos2d-x-2/ProjectX/libs/cocos2dx/platform/third_party/ios/libraries\" -L\"/Users/kreal/Desktop/Dropbox/iOS/cocos2d-x-2/ProjectX/libs/libwebsockets/ios/lib\" -L/Users/kreal/Desktop/Dropbox/iOS/cocos2d-x-2/ProjectX/libs/Admob -F/Users/kreal/Library/Developer/Xcode/DerivedData/ProjectX-dlwyuxydggdginfxxboolxhgtphc/Build/Products/Debug-iphonesimulator -filelist /Users/kreal/Library/Developer/Xcode/DerivedData/ProjectX-dlwyuxydggdginfxxboolxhgtphc/Build/Intermediates/ProjectX.build/Debug-iphonesimulator/ProjectX.build/Objects-normal/i386/ProjectX.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -ObjC -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=4.3 -framework SystemConfiguration -framework MessageUI -framework CoreTelephony -framework AdSupport -framework StoreKit -framework QuartzCore -framework OpenGLES -framework OpenAL -framework AudioToolbox -framework AVFoundation -framework UIKit -framework Foundation -framework CoreGraphics -lcurl -lGoogleAdMobAds -lwebp -lwebsockets -Xlinker -dependency_info -Xlinker /Users/kreal/Library/Developer/Xcode/DerivedData/ProjectX-dlwyuxydggdginfxxboolxhgtphc/Build/Intermediates/ProjectX.build/Debug-iphonesimulator/ProjectX.build/Objects-normal/i386/KrealX_dependency_info.dat -o /Users/kreal/Library/Developer/Xcode/DerivedData/ProjectX-dlwyuxydggdginfxxboolxhgtphc/Build/Products/Debug-iphonesimulator/ProjectX.app/ProjectX

ld: warning: directory not found for option '-L"/Users/kreal/Desktop/Dev/iOS/cocos2d-x-2/ProjectX/libs/cocos2dx/platform/third_party/ios/libraries"'
ld: warning: directory not found for option '-L"/Users/kreal/Desktop/Dev/iOS/cocos2d-x-2/ProjectX/libs/libwebsockets/ios/lib"'
ld: library not found for -lcurl
clang: error: linker command failed with exit code 1 (use -v to see invocation)

#2

Here are the files you should have in that path:

E:\cocos2d-x-2.2\cocos2dx\platform\third_party\ios\libraries\libcurl.a
E:\cocos2d-x-2.2\cocos2dx\platform\third_party\ios\libraries\libwebp.a

Do you have those files?


#3

Hey vkreal,

I found that for some reason, something in the project settings had changed in the Library Search Paths option in the Build Settings menu in your project file. Make sure that all ‘’ characters are either deleted, or replaced with ‘/’.

Hope that helps.