BASIC

Author Topic: iAd Banner - Technical only  (Read 41352 times)

Offline baicskillet

  • Mc. Print
  • *
  • Posts: 29
    • View Profile
Re: iAd Banner - Technical only
« Reply #30 on: 2010-Jul-22 »
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.
« Last Edit: 2010-Jul-22 by baicskillet »

Offline matchy

  • Prof. Inline
  • *****
  • Posts: 1543
    • View Profile
Re: iAd Banner - Technical only
« Reply #31 on: 2010-Jul-22 »
Those import function are for trucidare's lib.

How about landscape banner?

Offline baicskillet

  • Mc. Print
  • *
  • Posts: 29
    • View Profile
Re: iAd Banner - Technical only
« Reply #32 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.

Offline trucidare

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1377
  • Bachelor of Fail
    • View Profile
Re: iAd Banner - Technical only
« Reply #33 on: 2010-Jul-22 »
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

Offline ampos

  • Prof. Inline
  • *****
  • Posts: 1594
    • View Profile
    • AMpostata Website
Re: iAd Banner - Technical only
« Reply #34 on: 2010-Nov-19 »
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:

Quote
Build 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

Offline matchy

  • Prof. Inline
  • *****
  • Posts: 1543
    • View Profile
Re: iAd Banner - Technical only
« Reply #35 on: 2010-Nov-19 »
You'll need to add the CoreGraphics and iAd framework. That's what those errors are causing.

Offline ampos

  • Prof. Inline
  • *****
  • Posts: 1594
    • View Profile
    • AMpostata Website
Re: iAd Banner - Technical only
« Reply #36 on: 2010-Nov-19 »
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

Offline matchy

  • Prof. Inline
  • *****
  • Posts: 1543
    • View Profile
Re: iAd Banner - Technical only
« Reply #37 on: 2010-Nov-20 »
Are you serious? What's wrong with researching it? >:D

Offline ampos

  • Prof. Inline
  • *****
  • Posts: 1594
    • View Profile
    • AMpostata Website
Re: iAd Banner - Technical only
« Reply #38 on: 2010-Nov-20 »
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

Offline matchy

  • Prof. Inline
  • *****
  • Posts: 1543
    • View Profile
Re: iAd Banner - Technical only
« Reply #39 on: 2010-Nov-20 »
Right click on Frameworks folder.  :noggin:

Offline ampos

  • Prof. Inline
  • *****
  • Posts: 1594
    • View Profile
    • AMpostata Website
Re: iAd Banner - Technical only
« Reply #40 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

Offline matchy

  • Prof. Inline
  • *****
  • Posts: 1543
    • View Profile
Re: iAd Banner - Technical only
« Reply #41 on: 2010-Nov-20 »
And when you search for it on the net, there are 1000s of references.  :whistle:

Offline ampos

  • Prof. Inline
  • *****
  • Posts: 1594
    • View Profile
    • AMpostata Website
Re: iAd Banner - Technical only
« Reply #42 on: 2010-Nov-20 »
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

Offline matchy

  • Prof. Inline
  • *****
  • Posts: 1543
    • View Profile
Re: iAd Banner - Technical only
« Reply #43 on: 2010-Nov-20 »
Maybe it's just the view controller frame co-ords but not as I have to find out for myself soon. :S

Offline ampos

  • Prof. Inline
  • *****
  • Posts: 1594
    • View Profile
    • AMpostata Website
Re: iAd Banner - Technical only
« Reply #44 on: 2010-Nov-20 »
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