XCode linker error : library not found for -lAdMobDevice
Asked Answered
N

6

15

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

Nevus answered 24/9, 2009 at 14:13 Comment(1)
Are you dragging & dropping a file from an aliased directory? That's what I did. The moment I copied the file to another directory and then dragged & dropped into the project it worked. Enough to drive you completely insane isn't it !!Antilogism
C
23

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.

Costly answered 29/11, 2009 at 12:32 Comment(1)
+1 for that: solved the same problem for me. I haven't checked for sure, but one would assume that XCode must add some additional search paths and/or linker flags when the library/framework is added in this way.Colorable
R
16

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.

Resnick answered 18/6, 2015 at 20:45 Comment(0)
C
5

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

Cramfull answered 21/9, 2013 at 20:37 Comment(1)
I am facing the same issue, But installing the pods again are of no use !! Is there any other alternative ..Dramshop
N
0

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

Nevus answered 25/9, 2009 at 12:38 Comment(1)
no use in removing ALL frameworks & libraries to solve this issue. Just the relevant ones.Ophiolatry
M
0

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.

Metallo answered 8/3, 2013 at 4:20 Comment(0)
C
0

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)

Cause answered 21/2, 2017 at 15:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.