Linking errors when adding AdMob to IOS cocos2d-x 3.2

我们两清 提交于 2019-12-05 05:59:14

-ObjC Loads all members of static archive libraries that implement an Objective-C class or category.(https://developer.apple.com/library/mac/qa/qa1490/_index.html)

In cocos2d-x 3.2

CCController-iOS.mm -> #import <GameController/GameController.h>
UIVideoPlayerIOS.mm ->#import <MediaPlayer/MediaPlayer.h>

so you got those errors.

Solution: Just add following frameworks BuildSettings -> Build Phase -> Link Binary with libraries

MediaPlayer.framework
GameController.framework

Yes the reason was -ObjC flag added for AdMob support. I have add MediaPlayer.framework to my project and it solved problems for me.

Adding the path to libGoogleAdMobAds.a in Other Linker Flags worked for me. Note I'm using Mopub with Cocos2d-x 3.0.

http://discuss.cocos2d-x.org/t/linking-errors-when-adding-admob-to-ios-cocos2d-x-3-2/15672

AdMob iOS SDK version 7.0 is released as a framework. You don't need to add -ObjC linker option and extra dependencies if you use it. Also it is optimised for iOS 8.0. If you switch to 7.0 all your linking errors will disappear.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!