Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GoogleAdMobAds in iphone sdk

I had imported libGoogleAdMobAds.a and Adsupport framework in my projects. and all header files.Linker flag as :- -0bjC.Architecture is armv7. Xcode:- 4.5.2 and ios 4.3 and above.

But still it gives me the below error:-

Undefined symbols for architecture i386:
      "_CGSizeFromGADAdSize", referenced from:
          -[BannerExampleViewController viewDidLoad] in BannerExampleViewController.o
      "_OBJC_CLASS_$_GADBannerView", referenced from:
          objc-class-ref in BannerExampleViewController.o
      "_OBJC_CLASS_$_GADRequest", referenced from:
          objc-class-ref in BannerExampleViewController.o
      "_kGADAdSizeBanner", referenced from:
          -[BannerExampleViewController viewDidLoad] in BannerExampleViewController.o
    ld: symbol(s) not found for architecture i386
    clang: error: linker command failed with exit code 1 (use -v to see invocation)

Can anyone help me how to solve this.

Thanks in advance

like image 736
ios developer Avatar asked Feb 27 '13 13:02

ios developer


2 Answers

There are two steps you have to take:

  1. In Build Setting, go for Linking. In this, you will find "other linker flags." Set -Objc for build and release.
  2. You will be initializing the Admob with the defined rect. Consider: AbMod = [GADBannerView alloc]initWithFrame:CGRectMake(0,430,320,50)];
like image 142
Raju goud Bingi Avatar answered Oct 20 '22 15:10

Raju goud Bingi


for anyone who is getting this problem see if you are missing this file: libGoogleAdMobAds.a

its solve my problem.

idan m.

like image 21
Idan Magled Avatar answered Oct 20 '22 17:10

Idan Magled