objective c - AdMob not working: undefined reference to 'kGADAdSizeSmartBannerLandscape' -
i've made cocos2d game sprite builder , uses admob, conversion works fine without admob. after enabling admob these errors:
[5/7] linking build/android-armeabi-debug/vitamins/apk/lib/armeabi/libapplication.so failed: path=/users/aukevalk/.apportable/sdk/toolchain/macosx/binutils/arm-linux-androideabi/bin:$path ccache_cpp2=yes /users/aukevalk/.apportable/sdk/toolchain/macosx/clang/bin/clang++ -o /users/aukevalk/.apportable/sdk/build/android-armeabi-debug/vitamins/apk/lib/armeabi/libapplication.so -arch armeabi -target arm-apportable-linux-androideabi -wl,--build-id --no-undefined -fuse-ld=gold -shared -wl,@/users/aukevalk/.apportable/sdk/lib/linker/bionic.wrap -wl,@/users/aukevalk/.apportable/sdk/lib/linker/opengl.wrap -wl,--as-needed -framework corefoundation -framework security -framework systemconfiguration -framework cfnetwork -framework foundation -framework coregraphics -framework imageio -framework bridgekit -framework coretelephony -framework googleplayservices -framework mplib -framework openal -framework opengles -framework quartzcore -framework coremotion -framework coretext -framework coreimage -framework uikit -framework coreaudio -framework audiofile -framework audiounit -framework corevideo -framework audiotoolbox -framework coremedia -framework mediatoolbox -framework avfoundation -framework storekit -framework messageui -framework glkit -framework adsupport -wl,--whole-archive /users/aukevalk/.apportable/sdk/sysroot/usr/local/lib/armeabi/libzlib.a /users/aukevalk/.apportable/sdk/sysroot/usr/local/lib/armeabi/libverde_android.a /users/aukevalk/.apportable/sdk/build/android-armeabi-debug/com.falcko.vitamins/objectivechipmunk-iphone/libobjectivechipmunk-iphone.a /users/aukevalk/.apportable/sdk/build/android-armeabi-debug/com.falcko.vitamins/cocos2d/libcocos2d.a /users/aukevalk/.apportable/sdk/build/android-armeabi-debug/com.falcko.vitamins/vitamins/libvitamins.a -wl,--no-whole-archive --sysroot=/users/aukevalk/.apportable/sdk/sysroot -legl -lglesv1_cm -lglesv2 -llog -ljnigraphics -legl -lglesv1_cm -lglesv2 -lstdc++ /users/aukevalk/.apportable/sdk/sysroot/usr/local/lib/armeabi/libv.so /users/aukevalk/.apportable/sdk/sysroot/usr/local/lib/armeabi/libcxx.so /users/aukevalk/.apportable/sdk/sysroot/usr/local/lib/armeabi/libsystem.so /users/aukevalk/.apportable/sdk/sysroot/usr/local/lib/armeabi/libicu.so /users/aukevalk/.apportable/sdk/sysroot/usr/local/lib/armeabi/libxml2.so /users/aukevalk/.apportable/sdk/sysroot/usr/local/lib/armeabi/libcommoncrypto.so /users/aukevalk/.apportable/sdk/sysroot/usr/local/lib/armeabi/libcrypto_1_01h.so /users/aukevalk/.apportable/sdk/sysroot/usr/local/lib/armeabi/libssl_1_01h.so /users/aukevalk/.apportable/sdk/sysroot/usr/local/lib/armeabi/libgraphicsservices.so /users/aukevalk/.apportable/sdk/sysroot/usr/local/lib/armeabi/libgles_apportable.so /users/aukevalk/.apportable/sdk/sysroot/usr/local/lib/armeabi/libpango.so /users/aukevalk/documents/apps/iphone/vitamins/vitamins.spritebuilder/source/appdelegate.m:163: error: undefined reference 'kgadadsizesmartbannerlandscape' /users/aukevalk/documents/apps/iphone/vitamins/vitamins.spritebuilder/source/appdelegate.m:163: error: undefined reference 'kgadadsizesmartbannerportrait' /users/aukevalk/.apportable/sdk/build/android-armeabi-debug/com.falcko.vitamins/vitamins/libvitamins.a(appdelegate.m.o):/users/aukevalk/documents/apps/iphone/vitamins/vitamins.spritebuilder/source/appdelegate.m:function l_objc_classlist_references_$_32: error: undefined reference 'objc_class_$_gadbannerview' /users/aukevalk/.apportable/sdk/build/android-armeabi-debug/com.falcko.vitamins/vitamins/libvitamins.a(appdelegate.m.o):/users/aukevalk/documents/apps/iphone/vitamins/vitamins.spritebuilder/source/appdelegate.m:function l_objc_classlist_references_$_49: error: undefined reference 'objc_class_$_gadrequest' clang: error: linker command failed exit code 1 (use -v see invocation) ninja: build stopped: subcommand failed. error: command failed: /users/aukevalk/.apportable/sdk/toolchain/macosx/ninja/ninja --no-strip-ansi-escapes -j 16 /users/aukevalk/.apportable/sdk/build/android-armeabi-debug/vitamins/vitamins-debug.apk
this createadmob function:
-(void)createadmobads
{
if (!mbannerview) { mbannertype = banner_type; if(mbannertype <= kbanner_portrait_bottom) mbannerview = [[gadbannerview alloc] initwithadsize:kgadadsizesmartbannerportrait]; else mbannerview = [[gadbannerview alloc] initwithadsize:kgadadsizesmartbannerlandscape]; // specify ad's "unit identifier." admob publisher id. mbannerview.adunitid = @"id_goes_here"; // let runtime know uiviewcontroller restore after taking // user wherever ad goes , add view hierarchy. mbannerview.rootviewcontroller = self.navcontroller; [self.navcontroller.view addsubview:mbannerview]; //#ifdef debug // gadrequest *request = [gadrequest request]; // request.testdevices = [nsarray arraywithobjects:gad_simulator_id, nil]; //#endif // initiate generic request load ad. [mbannerview loadrequest:[gadrequest request]]; cgsize s = [[ccdirector shareddirector] viewsize]; cgrect frame = mbannerview.frame; off_x = 0.0f; on_x = 0.0f; switch (mbannertype) { case kbanner_portrait_top: { off_y = -frame.size.height; on_y = 0.0f; } break; case kbanner_portrait_bottom: { off_y = s.height; on_y = s.height-frame.size.height; } break; case kbanner_landscape_top: { off_y = -frame.size.height; on_y = 0.0f; } break; case kbanner_landscape_bottom: { off_y = s.height; on_y = s.height-frame.size.height; } break; default: break; } frame.origin.y = off_y; frame.origin.x = off_x; mbannerview.frame = frame; [uiview beginanimations:nil context:nil]; [uiview setanimationduration:0.5]; [uiview setanimationcurve:uiviewanimationcurveeaseout]; frame = mbannerview.frame; frame.origin.x = on_x; frame.origin.y = on_y; mbannerview.frame = frame; [uiview commitanimations]; }
}
i hope guys have tip me on how fix problem. in advance!
falcko
Comments
Post a Comment