【发布时间】:2014-09-10 18:11:54
【问题描述】:
我正在尝试将 AdMob 添加到 cocos2d-x 3.2 简单游戏
使用 Xcode 5.1 iOS 7.1
我按照教程
https://developers.google.com/mobile-ads-sdk/docs/#ios
和
http://plaincode.blogspot.co.il/2014/02/example-of-admob-integration-in-cocos2d.html
在“其他链接器标志”中添加 -ObjC 标志后
我收到链接错误:
Undefined symbols for architecture armv7s:
"_GCControllerDidDisconnectNotification", referenced from:
-[GCControllerConnectionEventHandler observerConnection:disconnection:] in libcocos2dx iOS.a(CCController-iOS.o)
"_GCControllerDidConnectNotification", referenced from:
-[GCControllerConnectionEventHandler observerConnection:disconnection:] in libcocos2dx iOS.a(CCController-iOS.o)
"_OBJC_CLASS_$_MPMoviePlayerController", referenced from:
objc-class-ref in libcocos2dx iOS.a(UIVideoPlayerIOS.o)
"_OBJC_CLASS_$_GCController", referenced from:
objc-class-ref in libcocos2dx iOS.a(CCController-iOS.o)
(maybe you meant: _OBJC_CLASS_$_GCControllerConnectionEventHandler)
"_MPMoviePlayerPlaybackStateDidChangeNotification", referenced from:
-[UIVideoViewWrapperIos dealloc] in libcocos2dx iOS.a(UIVideoPlayerIOS.o)
-[UIVideoViewWrapperIos setURL::] in libcocos2dx iOS.a(UIVideoPlayerIOS.o)
"_MPMoviePlayerPlaybackDidFinishNotification", referenced from:
-[UIVideoViewWrapperIos dealloc] in libcocos2dx iOS.a(UIVideoPlayerIOS.o)
-[UIVideoViewWrapperIos setURL::] in libcocos2dx iOS.a(UIVideoPlayerIOS.o)
ld: symbol(s) not found for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)
当我删除 -ObjC 标志时 然后我得到:
<Google> Category methods are not loaded. Make sure you link the Google Mobile Ads library using one of the -ObjC, -force_load, or -all_load linker flags. See https://developers.google.com/mobile-ads-sdk/docs/#ios for more information.
这里有什么问题?
【问题讨论】:
-
我建议使用 plugin-x
-
什么意思,有没有现成的admob iOS插件?
-
是的,它叫plugin-x,它自带cocos2d-x,google一下。
-
plugin-x 据我所知,它只是制作插件的定义,但我没有找到适用于 iOS 的 adMob 的任何实现
-
那里有 AdMob 和 Flurry 的示例
标签: objective-c admob cocos2d-x cocos2d-x-3.0