iAd Banner - Technical only

Previous topic - Next topic

baicskillet

#30
Ok, I figured, glb_iad_init only makes the rectangle where the banners are supposed to be. And glb_iad_init, glb_iad_hide and glb_iad_show are for actually putting the banners. Did i get it right?
It compiles for me, but it gives warnings about possible unassigned variables, time_to_show, time_to_hide, and banner_state.

matchy

Those import function are for trucidare's lib.

How about landscape banner?

baicskillet

Quote from: matchy on 2010-Jul-22
Those import function are for trucidare's lib.

How about landscape banner?

Ok, got it. But, did I get it right with my previous post? I'm a noob, i know.

trucidare

GLB_iAd is the Init function. Call it on start of zour GLBasic tool.
MacBook Pro 2,2 GHz Core 2 Duo, 4 GB RAM, 160 GB HDD, 8600M GT
Core i3 - 3,07 GHz, 8 GB Ram, 2.5 TB HDD, Geforce GTX 260+ OC

ampos

I am adding this to a iPhone game.

I placed  the libiad.a file in xcode/glbasic/libs/

Then, in the XCode project I drag the file into the "Frameworks" line on the left of xcode window.

I added the following to the GLB source:
Code (glbasic) Select

IMPORT "C" void GLB_iAd()
IMPORT "C" void GLB_iAd_Hide() // to hide the banner
IMPORT "C" void GLB_iAd_Show() // to show banner after hide


I can compile as Win with no errors.

My source:
Code (glbasic) Select

IMPORT "C" void GLB_iAd()
IMPORT "C" void GLB_iAd_Hide() // to hide the banner
IMPORT "C" void GLB_iAd_Show() // to show banner after hide

LOADBMP "start.png"
GLB_iAD()
SHOWSCREEN;REPEAT;UNTIL MOUSEAXIS(3)=1
...//rest of source



As soon as I add the line GLB_iAD(), GLB does not compile woth the folowing error:
Quote
linking:
gpc_temp0.o:gpc_temp0.cpp:(.text+0xdc2c): undefined reference to `_GLB_iAd'
*** FATAL ERROR - Please post this output in the forum

But I can compile as target->iPhone with no errors ON GLB.

Once in Mac with xCode, If I try to build&run, I get a ton of errors:

QuoteBuild iPhone of project iPhone with configuration Debug

Check dependencies

[WARN]Warning: The Copy Bundle Resources build phase contains this target's Info.plist file 'iPhone-Info.plist'.

Ld build/iPhone.build/Debug-iphoneos/iPhone.build/Objects-normal/armv6/iPhone normal armv6
cd /Volumes/Proyectos/MagicBox/XCode/GLBasic
setenv IPHONEOS_DEPLOYMENT_TARGET 3.0
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 -arch armv6 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.1.sdk -L/Volumes/Proyectos/MagicBox/XCode/GLBasic/build/Debug-iphoneos -L/Volumes/Proyectos/MagicBox/XCode/GLBasic/Lib -F/Volumes/Proyectos/MagicBox/XCode/GLBasic/build/Debug-iphoneos -filelist /Volumes/Proyectos/MagicBox/XCode/GLBasic/build/iPhone.build/Debug-iphoneos/iPhone.build/Objects-normal/armv6/iPhone.LinkFileList -dead_strip -lstdc++ -miphoneos-version-min=3.0 -framework Foundation -framework UIKit -framework OpenGLES -framework QuartzCore -framework AudioToolbox -framework CoreLocation -framework OpenAL -lGLBasiciPhone-egl -lpng-gf -lPROGRAM -framework MediaPlayer -liAd -o /Volumes/Proyectos/MagicBox/XCode/GLBasic/build/iPhone.build/Debug-iphoneos/iPhone.build/Objects-normal/armv6/iPhone

Undefined symbols:
  "_CGRectOffset", referenced from:
      -[Exports _GLB_iAd_Show] in libiAd.a(Exports.o)
      -[Exports _GLB_iAd_Hide] in libiAd.a(Exports.o)
  "_ADBannerContentSizeIdentifier320x50", referenced from:
      _ADBannerContentSizeIdentifier320x50$non_lazy_ptr in libiAd.a(Exports.o)
     (maybe you meant: _ADBannerContentSizeIdentifier320x50$non_lazy_ptr)
  "_ADBannerContentSizeIdentifier480x32", referenced from:
      _ADBannerContentSizeIdentifier480x32$non_lazy_ptr in libiAd.a(Exports.o)
     (maybe you meant: _ADBannerContentSizeIdentifier480x32$non_lazy_ptr)
  "_OBJC_CLASS_$_ADBannerView", referenced from:
      _OBJC_CLASS_$_Exports in libiAd.a(Exports.o)
      objc-class-ref-to-ADBannerView in libiAd.a(Exports.o)
  "_OBJC_METACLASS_$_ADBannerView", referenced from:
      _OBJC_METACLASS_$_Exports in libiAd.a(Exports.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status

Ld build/iPhone.build/Debug-iphoneos/iPhone.build/Objects-normal/armv7/iPhone normal armv7
cd /Volumes/Proyectos/MagicBox/XCode/GLBasic
setenv IPHONEOS_DEPLOYMENT_TARGET 3.0
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 -arch armv7 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.1.sdk -L/Volumes/Proyectos/MagicBox/XCode/GLBasic/build/Debug-iphoneos -L/Volumes/Proyectos/MagicBox/XCode/GLBasic/Lib -F/Volumes/Proyectos/MagicBox/XCode/GLBasic/build/Debug-iphoneos -filelist /Volumes/Proyectos/MagicBox/XCode/GLBasic/build/iPhone.build/Debug-iphoneos/iPhone.build/Objects-normal/armv7/iPhone.LinkFileList -dead_strip -lstdc++ -miphoneos-version-min=3.0 -framework Foundation -framework UIKit -framework OpenGLES -framework QuartzCore -framework AudioToolbox -framework CoreLocation -framework OpenAL -lGLBasiciPhone-egl -lpng-gf -lPROGRAM -framework MediaPlayer -liAd -o /Volumes/Proyectos/MagicBox/XCode/GLBasic/build/iPhone.build/Debug-iphoneos/iPhone.build/Objects-normal/armv7/iPhone

Undefined symbols:
  "_CGRectOffset", referenced from:
      -[Exports _GLB_iAd_Show] in libiAd.a(Exports.o)
      -[Exports _GLB_iAd_Hide] in libiAd.a(Exports.o)
  "_ADBannerContentSizeIdentifier320x50", referenced from:
      _ADBannerContentSizeIdentifier320x50$non_lazy_ptr in libiAd.a(Exports.o)
     (maybe you meant: _ADBannerContentSizeIdentifier320x50$non_lazy_ptr)
  "_ADBannerContentSizeIdentifier480x32", referenced from:
      _ADBannerContentSizeIdentifier480x32$non_lazy_ptr in libiAd.a(Exports.o)
     (maybe you meant: _ADBannerContentSizeIdentifier480x32$non_lazy_ptr)
  "_OBJC_CLASS_$_ADBannerView", referenced from:
      _OBJC_CLASS_$_Exports in libiAd.a(Exports.o)
      objc-class-ref-to-ADBannerView in libiAd.a(Exports.o)
  "_OBJC_METACLASS_$_ADBannerView", referenced from:
      _OBJC_METACLASS_$_Exports in libiAd.a(Exports.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status

PLEASE, can someone help me, or make a iAD Guide for TotalNoobs?
check my web and/or my blog :D
http://diniplay.blogspot.com (devblog)
http://www.ampostata.org
http://ampostata.blogspot.com
I own PC-Win, MacBook 13", iPhone 3G/3GS/4G and iPAC-WinCE

matchy

You'll need to add the CoreGraphics and iAd framework. That's what those errors are causing.

ampos

What/where is this core thing?
check my web and/or my blog :D
http://diniplay.blogspot.com (devblog)
http://www.ampostata.org
http://ampostata.blogspot.com
I own PC-Win, MacBook 13", iPhone 3G/3GS/4G and iPAC-WinCE

matchy

Are you serious? What's wrong with researching it? >:D

ampos

I have been searching, and found nothing. Where do I find this CoreGraphics thing?
check my web and/or my blog :D
http://diniplay.blogspot.com (devblog)
http://www.ampostata.org
http://ampostata.blogspot.com
I own PC-Win, MacBook 13", iPhone 3G/3GS/4G and iPAC-WinCE

matchy

Right click on Frameworks folder.  :noggin:

ampos

Quote from: matchy on 2010-Nov-20
Right click on Frameworks folder.  :noggin:

->right click on Framework folder -> Add -> Existing Framework
check my web and/or my blog :D
http://diniplay.blogspot.com (devblog)
http://www.ampostata.org
http://ampostata.blogspot.com
I own PC-Win, MacBook 13", iPhone 3G/3GS/4G and iPAC-WinCE

matchy

And when you search for it on the net, there are 1000s of references.  :whistle:

ampos

I have also added the existing framework "iad.framework" to frameworks folder (when I got it running, will post here a "dumb-guide").

Ok, now xcode compiles, but after running, I got this error in xcode debugger:
Quote
mi_cmd_stack_list_frames: Not enough frames in stack.

(PS: how do I setup the ad on the botton of the screen?)
check my web and/or my blog :D
http://diniplay.blogspot.com (devblog)
http://www.ampostata.org
http://ampostata.blogspot.com
I own PC-Win, MacBook 13", iPhone 3G/3GS/4G and iPAC-WinCE

matchy

Maybe it's just the view controller frame co-ords but not as I have to find out for myself soon. :S

ampos

And the xcode debuuger error? The app does not launch...
check my web and/or my blog :D
http://diniplay.blogspot.com (devblog)
http://www.ampostata.org
http://ampostata.blogspot.com
I own PC-Win, MacBook 13", iPhone 3G/3GS/4G and iPAC-WinCE