The only thing you seem to be doing wrong:
At the end of your GLBasic file you have this as INLINE code:
// .h ////////////
// iAdBanner with GLB
#import "iAd/ADBannerView.h"
@interface AppViewController : UIViewController <ADBannerViewDelegate> {
ADBannerView * bannerView;
UIView * _appView;
UIWindow * _appWindow;
}
@property (nonatomic, retain) IBOutlet UIView * appView;
@property (nonatomic, retain) IBOutlet ADBannerView * bannerView;
@property (nonatomic, retain) IBOutlet UIWindow * appWindow;
- (void)createBannerView;
- (void)showBanner;
- (void)hideBanner;
- (void)changeBannerOrientation:(UIInterfaceOrientation)toOrientation;
@end
// .mm ///////////////
#import "AppViewController.h"
@implementation AppViewController
@synthesize appView = _appView;
@synthesize bannerView; // = _bannerView;
@synthesize appWindow = _appWindow;
# pragma mark -
# pragma mark View
- (void)viewDidLoad {
[super viewDidLoad];
// NSLog(@"viewDidLoad");
}
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
// NSLog(@"viewDidAppear");
}
//- (void)viewWillAppear:(BOOL)animated {
// NSLog(@"viewWillAppear");
// if (bannerView) {
// UIInterfaceOrientation orientation=self.interfaceOrientation;
// [self changeBannerOrientation:orientation];
// }
//}
- (void)dealloc {
[super dealloc];
}
//- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
//
// return (interfaceOrientation == UIInterfaceOrientationPortrait) | (interfaceOrientation == UIInterfaceOrientationLandscapeLeft) | (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
//}
#pragma mark -
#pragma mark ADBanner
//- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
//if (bannerView) {
// [self changeBannerOrientation:toInterfaceOrientation];
//}
// NSLog(@"shouldAutorotate");
//}
- (void)changeBannerOrientation:(UIInterfaceOrientation)toOrientation {
if (UIInterfaceOrientationIsLandscape(toOrientation)) {
bannerView.currentContentSizeIdentifier=ADBannerContentSizeIdentifierLandscape;
self.view.frame=CGRectMake(0,0, 320, 120);
} else {
bannerView.currentContentSizeIdentifier=ADBannerContentSizeIdentifierPortrait;
self.view.frame=CGRectMake(0,0, 480, 100);
}
}
- (void)bannerViewDidLoadAd:(ADBannerView *)banner {
NSLog(@"bannerViewDidLoad");
// self.bannerView.hidden=NO;
[self showBanner];
}
- (void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error {
// self.bannerView.hidden=YES;
// NSLog(@"bannerView");
NSLog(@"E R R O R: '%@'",error);
// [self hideBanner];
}
- (void)createBannerView {
// NSLog(@"Banner creating...");
_appWindow = [[UIApplication sharedApplication] keyWindow];
bannerView=[[[ADBannerView alloc] init] autorelease];
bannerView.delegate=self;
self.view.frame = CGRectMake(0,0, 768, 66);
bannerView.frame=CGRectMake(0,-66, 768, 66);
bannerView.currentContentSizeIdentifier=ADBannerContentSizeIdentifierPortrait;
[self.view addSubview:self.bannerView];
[_appWindow addSubview:self.view];
[_appWindow makeKeyWindow];
// [_appWindow makeKeyAndVisible];
}
- (void)showBanner {
// NSLog(@"Show banner");
CGRect bannerFrame=bannerView.frame;
bannerFrame.origin.y=0;
[UIView beginAnimations:@"showBanner" context:NULL];
bannerView.frame=bannerFrame;
[UIView commitAnimations];
}
- (void)hideBanner {
// NSLog(@"Hide banner");
CGRect bannerFrame=bannerView.frame;
bannerFrame.origin.y=-bannerFrame.size.height;
bannerView.frame=bannerFrame;
}
#pragma mark -
#pragma mark GLB
- (void)initBanner {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc]init];
[self performSelectorOnMainThread:@selector(createBannerView) withObject:nil waitUntilDone:YES];
[pool release];
}
@end
extern "C" void glb_BannerInit() {
AppViewController * UIGlbasic;
UIGlbasic = [[AppViewController alloc] init];
[UIGlbasic createBannerView];
// [UIGlbasic release];
[UIGlbasic retain];
}
GLBasic doesn't like this style of code as INLINE code, hence all the errors about the "@" and "-" symbols.
GLBasic's INLINE code is in "C++" not "Objective-C".
Instead, the simplest way I think is to use XCode for "Objective-C" code. Don't worry I'll list steps in a second.
Unfortunately I can't make a video or even test this at the moment

but from what I know this should work:
- Make a new file called something like "iAd.mm" - just make sure it ends in ".mm"
- Open the new file "iAd.mm" in a text editor (e.g. notepad)
- Copy the code I listed above from the end of your file into "iAd.mm" and save it.
- Delete the block of INLINE code from the end
- Delete this INLINE code from the end of your file.
- Leave the 'IMPORT' commands in your file.
- Compile your GLB project for XCode - it should work without any problems.
- Move "iAd.mm" into your XCode project folder with the other GLBasic files.
- Copy the XCode project onto your Mac, and open it in XCode.
- Click and drag "iAd.mm" into the 'Classes' folder in XCode, shown in Matchy's screenshot.
- Hit 'Build and Run' in XCode and see if it works!
I hope that you can understand that despite language problems, and I also hope it works... then I won't need to bother testing
