2

I added a GoogleAdMobAdsSdkiOS-6.1.4 SDK to my cocos2d app in order to integrate AdWhirl. When I added this Google SDK I got the following error:

Expected expression before '@' token main.m

This is the code looks like:

int main(int argc, char *argv[]) {
    @autoreleasepool {
        return UIApplicationMain(argc, argv, nil,
                                 NSStringFromClass([AppDelegate class]));
    }
}
mttrb
  • 8,297
  • 3
  • 35
  • 57

2 Answers2

0

Are you sure that you're using a version of XCode that is 4.2 or above? I think @autoreleasepool is a newer syntax. This also won't work if your compiler is set to GCC. You can also just create your own NSAutoreleasePool using the old syntax if none of this works.

You can look at another answer to a similar question here.

Community
  • 1
  • 1
RajPara
  • 2,281
  • 1
  • 16
  • 9
  • I am using 4.4.1... I contacted AdWhirl and they stated that the new AdMob SDK is not supported by them. – user1530506 Sep 14 '12 at 00:26
  • anymore..... It used to be with their older SDK. I know that there is a way but I have not been able to figure it out. – user1530506 Sep 14 '12 at 01:52
  • Have you tried just changing the syntax for your autorelease pool's declaration as stated at http://stackoverflow.com/questions/8553278/coreplot-expected-token-before-token? – RajPara Sep 17 '12 at 15:50
0

You don't need add Add-ons folder from Google ad sdk.

conecon
  • 404
  • 4
  • 10