Jugs
Jugs

Reputation: 364

XCode linker error : library not found for -lAdMobDevice

I am trying to build lite version of my iPhone application using AdMob. I followed the guidelines here http://www.iphonedevsdk.com/forum/iphone-sdk-development/11358-creating-lite-version-app.html and created two different targets. In the lite version I added a macro called LITEVERSION which I am checking using #ifdef and doing the appropriate things.

But when I build the lite version of the app, I get a linker error

ld: library not found for -lAdMobDevice collect2: ld returned 1 exit status

However I am able to build the full version without any issues and also noticed that build is working fine (for the fullversion) even if I remove the #ifdef macros. This suggests that the libAdMobSimulator.a library is linking properly for the full version however it fails on the lite version.

Any pointers would be greatly appreciated!

Cheers Jugs

Upvotes: 15

Views: 39443

Answers (6)

Roxana
Roxana

Reputation: 271

I had the same problem with Google Analytics library. My problem was that I forgot to add the path to the Library Search Paths in my target's build settings. (Target -> Build Settings -> Library Search Paths)

Upvotes: 0

zeeawan
zeeawan

Reputation: 6905

I got similar error as I was using CocoaPods libraries

library not found for -lPods-MyApp

I got the error because I opened xcode project instead of workspace.

Upvotes: 16

westonplatter
westonplatter

Reputation: 1495

I was using CocoaPods, and ran pod install, and that fixed it.

Upvotes: 5

kenshin
kenshin

Reputation: 3

I cause this because of a libray libMobClickLibrary.a which is used in youmeng sdk missed. I fix the issued after copy libMobClickLibrary.a to the project floder.

Upvotes: 0

Kris Jenkins
Kris Jenkins

Reputation: 4210

When I had this problem, the cause was that I'd added the library into Xcode by dragging it in like a regular source file.

The fix was to remove it, and then add it properly using the "Add->Existing Frameworks..." dialogue.

Upvotes: 23

Jugs
Jugs

Reputation: 364

I figured out what he problem was. I just removed all frameworks and libraries and added them back in for both the targets and it worked!

Cheers

Upvotes: 0

Related Questions