Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / why can't I include "agk.h" file?

Author
Message
halley
12
Years of Service
User Offline
Joined: 27th Apr 2011
Location: China
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?

give my best
ElijahNomad
12
Years of Service
User Offline
Joined: 19th Sep 2011
Location:
Posted: 23rd Sep 2011 21:22
Sounds like your development environment may not be set up. Are you using Xcode or Visual Studio ?
halley
12
Years of Service
User Offline
Joined: 27th Apr 2011
Location: China
Posted: 24th Sep 2011 06: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?

give my best
ElijahNomad
12
Years of Service
User Offline
Joined: 19th Sep 2011
Location:
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
halley
12
Years of Service
User Offline
Joined: 27th Apr 2011
Location: China
Posted: 24th Sep 2011 22:13
just copy them to project folder? is that enough?

give my best
ElijahNomad
12
Years of Service
User Offline
Joined: 19th Sep 2011
Location:
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 ?
halley
12
Years of Service
User Offline
Joined: 27th Apr 2011
Location: China
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.

give my best
ElijahNomad
12
Years of Service
User Offline
Joined: 19th Sep 2011
Location:
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.
halley
12
Years of Service
User Offline
Joined: 27th Apr 2011
Location: China
Posted: 25th Sep 2011 06: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?

give my best
halley
12
Years of Service
User Offline
Joined: 27th Apr 2011
Location: China
Posted: 25th Sep 2011 08:32 Edited at: 25th Sep 2011 08:33
the following is mistakes:



give my best
halley
12
Years of Service
User Offline
Joined: 27th Apr 2011
Location: China
Posted: 25th Sep 2011 17:22
ElijahNomad,r u here?
anyone can help?
I really need to know how to solve the problem.

give my best
ElijahNomad
12
Years of Service
User Offline
Joined: 19th Sep 2011
Location:
Posted: 26th Sep 2011 04: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.
halley
12
Years of Service
User Offline
Joined: 27th Apr 2011
Location: China
Posted: 26th Sep 2011 05: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?

give my best
halley
12
Years of Service
User Offline
Joined: 27th Apr 2011
Location: China
Posted: 26th Sep 2011 06: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?

give my best
ElijahNomad
12
Years of Service
User Offline
Joined: 19th Sep 2011
Location:
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
halley
12
Years of Service
User Offline
Joined: 27th Apr 2011
Location: China
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.


give my best
halley
12
Years of Service
User Offline
Joined: 27th Apr 2011
Location: China
Posted: 27th Sep 2011 05:23
another question:
what if I move these files to windows,can VS2008 recognize .mm file?

give my best
ElijahNomad
12
Years of Service
User Offline
Joined: 19th Sep 2011
Location:
Posted: 27th Sep 2011 05:54
Hey Halley, when moving file back to Visual Studio you have to rename your files as normal C++ files.
halley
12
Years of Service
User Offline
Joined: 27th Apr 2011
Location: China
Posted: 27th Sep 2011 08:12
I see. but it's not convenient.

give my best
LeeBamber
TGC Lead Developer
24
Years of Service
User Offline
Joined: 21st Jan 2000
Location: England
Posted: 9th Oct 2011 03: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.

I drink tea, and in my spare time I write software.
halley
12
Years of Service
User Offline
Joined: 27th Apr 2011
Location: China
Posted: 9th Oct 2011 06:33
Lee ,Thank you very much. I learned a lot.

give my best

Login to post a reply

Server time is: 2024-04-16 21:27:50
Your offset time is: 2024-04-16 21:27:50