Posted: 23rd Sep 2011 10:46
I created a class named CGame. there r two files, CGame.h and CGame.cpp

in the CGame.h, I included the "AGK.h" file. there r 201 mistakes.
in the CGame.cpp ,the situation is just the same .

Now I really need help. I usually make games with classes. all kinds of classes. such as CScore CMusic CSound and so on.

but now I can't include agk.h in my classes files. why?
Posted: 23rd Sep 2011 21:22
Sounds like your development environment may not be set up. Are you using Xcode or Visual Studio ?
Posted: 24th Sep 2011 6:12
I have used Visual Studio for five years ,and is very familiar with it.

This is the first time for me to use Xcode 4.1. I met many problems.

I don't know how to set the .h file and .lib file.

Can u help me?
Posted: 24th Sep 2011 18:58
When I created my new project all i did was copy the include and the library files into my project. These are found in. I'm also new to xCode and iPhone development currently making a template similar to cocos2d. When done I'll post and share

AGK/IDE/common/include
AGK/IDE/platform/apple/lib/Debug
AGK/IDE/platform/apple/lib/Release
Posted: 24th Sep 2011 22:13
just copy them to project folder? is that enough?
Posted: 24th Sep 2011 22:20
Make sure the libAGKIOS.a file is in the Frameworks folder. Also make sure you can access the AGK.h and other header files and you should be good. BTW are you editing a template project the came with AppGameKit or starting from scratch ?
Posted: 24th Sep 2011 22:26
when I write "agk.h" in my .h file, there are 201 mistakes.

I add lib file to the frameworks.
Posted: 24th Sep 2011 23:22
What type of mistakes are you getting. Are you starting a project from scratch ? Try and post a screen shot.
Posted: 25th Sep 2011 6:11
I start a project from AppGameKit template.
I don't know how to post a picture.
the mistakes all happened in system files ,such as NSobjCRuntime.h,NSzone.h NSObject.h and so on.
the mistake is "expected unqualified-id before '@' token.

Do u meet such a mistake?
Posted: 25th Sep 2011 8:32
the following is mistakes:

+ Code Snippet
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:252: error: expected unqualified-id before '@' token


/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:254: error: expected constructor, destructor, or type conversion before '*' token


/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:255: error: 'NSString' was not declared in this scope


/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:255: error: 'aSelectorName' was not declared in this scope


/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:257: error: expected constructor, destructor, or type conversion before '*' token


/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:258: error: 'NSString' was not declared in this scope


/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:258: error: 'aClassName' was not declared in this scope


/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:260: error: expected constructor, destructor, or type conversion before '*' token


/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:261: error: expected constructor, destructor, or type conversion before '*' token


/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:265: error: variable or field 'NSLog' declared void


/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:265: error: 'NSString' was not declared in this scope


/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:265: error: 'format' was not declared in this scope


/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:265: error: expected primary-expression before '...' token


/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:266: error: variable or field 'NSLogv' declared void


/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:266: error: 'NSString' was not declared in this scope


/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:266: error: 'format' was not declared in this scope


/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:266: error: expected primary-expression before 'args'


/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSZone.h:8: error: expected unqualified-id before '@' token


/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSZone.h:16: error: 'NSString' has not been declared


/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSZone.h:17: error: expected constructor, destructor, or type conversion before '*' token


/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:8: error: expected unqualified-id before '@' token


/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:9: error: expected unqualified-id before '@' token


/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:13: error: expected unqualified-id before '@' token
Posted: 25th Sep 2011 17:22
ElijahNomad?r u here?
anyone can help?
I really need to know how to solve the problem.
Posted: 26th Sep 2011 4:26
Sorry for the late response. From what your errors say it could be that you need to upgrade your version on Xcode. You said your using 4.1 but your errors are targeting 4.3. Hope this helps. We'll figure this out.
Posted: 26th Sep 2011 5:22
4.1 is the newest version for Xcode I think. I can't get a newer version for it.
any official can help me?
Posted: 26th Sep 2011 6:07
All errors happened in the system files.and on one happened in my code.
It's very difficult for me to fix the errors. At least I can't modify the system files,such as NSObjCRuntime.h.

I really need help. Can anyone help me?
Posted: 26th Sep 2011 17:21
maybe you need to change your C++ files to .mm that tells xCode to treat your C++ files as Objective C++. Hope this helps
Posted: 26th Sep 2011 17:56
to ElijahNomad
Thank u very much. I did as what u said. It really works.

But I still don't know why this situation will happen.Hope official can solve the problem.
Posted: 27th Sep 2011 5:23
another question:
what if I move these files to windows,can VS2008 recognize .mm file?
Posted: 27th Sep 2011 5:54
Hey Halley, when moving file back to Visual Studio you have to rename your files as normal C++ files.
Posted: 27th Sep 2011 8:12
I see. but it's not convenient.
Posted: 9th Oct 2011 3:10
The .MM extension is exclusive to Objective C (mixed mode). There should be no need to do any renaming, as you can include CPP files in your XCODE project just fine providing you set the preferences for that file to the appropriate CPPOBJ format. See the XCODE templates for how we format our CPP file references.