XCode 链接器错误:找不到 -lAdMobDevice 的库 [英] XCode linker error : library not found for -lAdMobDevice

查看:29
本文介绍了XCode 链接器错误:找不到 -lAdMobDevice 的库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 AdMob 构建我的 iPhone 应用程序的精简版.我遵循了这里的指南 http://www.iphonedevsdk.com/forum/iphone-sdk-development/11358-creating-lite-version-app.html 并创建了两个不同的目标.在精简版中,我添加了一个名为 LITEVERSION 的宏,我正在使用 #ifdef 进行检查并执行相应的操作.

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:找不到 -lAdMobDevice 的库collect2: ld 返回 1 个退出状态

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

但是,我能够毫无问题地构建完整版本,并且还注意到即使我删除了 #ifdef 宏,构建也可以正常工作(对于完整版本).这表明 libAdMobSimulator.a 库为完整版正确链接,但在精简版上失败.

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.

任何指针将不胜感激!

干杯水壶

推荐答案

当我遇到这个问题时,原因是我像普通源文件一样将库添加到 Xcode 中.

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.

这篇关于XCode 链接器错误:找不到 -lAdMobDevice 的库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆