Problems with the GameState

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
Post Reply
User avatar
darkmaster
Halfling
Posts: 67
Joined: Wed Mar 09, 2005 7:04 pm
Location: Netherland

Problems with the GameState

Post by darkmaster » Sat Apr 23, 2005 3:41 pm

hELLO all,

I implement the game state method which is shown in the wiki articles.
But when I try to run it, I got some erors which are very weird to me. Its happening when I try to use the CEGUI things in my apps.

C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\malloc.h(105) : error C2143: syntax error : missing ';' before '.'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\malloc.h(105) : warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\malloc.h(105) : error C2720: 'sMemManager' : '__declspec(dllimport ) ' storage-class specifier illegal on members
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\malloc.h(105) : error C2491: '`global namespace'::Ogre::MemoryManager::sMemManager' : definition of dllimport static data member not allowed
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\malloc.h(105) : error C2059: syntax error : '.'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\malloc.h(106) : error C2143: syntax error : missing ';' before '.'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\malloc.h(106) : warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\malloc.h(106) : error C2720: 'sMemManager' : '__declspec(dllimport ) ' storage-class specifier illegal on members
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\malloc.h(106) : error C2182: 'sMemManager' : illegal use of type 'void'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\malloc.h(106) : error C2491: '`global namespace'::Ogre::MemoryManager::sMemManager' : definition of dllimport static data member not allowed
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\malloc.h(106) : error C2059: syntax error : '.'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\malloc.h(107) : error C2143: syntax error : missing ';' before '.'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\malloc.h(107) : warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\malloc.h(107) : error C2720: 'sMemManager' : '__declspec(dllimport ) ' storage-class specifier illegal on members
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\malloc.h(107) : error C2491: '`global namespace'::Ogre::MemoryManager::sMemManager' : definition of dllimport static data member not allowed
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\malloc.h(107) : error C2059: syntax error : '.'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\malloc.h(108) : error C2143: syntax error : missing ';' before '.'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\malloc.h(108) : warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\malloc.h(108) : error C2720: 'sMemManager' : '__declspec(dllimport ) ' storage-class specifier illegal on members
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\malloc.h(108) : error C2491: '`global namespace'::Ogre::MemoryManager::sMemManager' : definition of dllimport static data member not allowed
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\malloc.h(108) : error C2059: syntax error : '.'

SOry to post all of this eror line, I really don't know the cause of this eror.

The program structure is looks like this

I have two header file:

GameEngine.h: it contains the class structure of GameManager, InPUTmANAGER, GameState

GameState.h: This is where my first state is made, SplashScreen state is the one causing problem. If I remove this, all the eror is gone.

two cpp file:
main.cpp:main call
GameEngine.cpp:the code for the GameEngine.h

I really dont understand what's wrong, hope anyone can suggest some solutions


Regards,


Dark
0 x
Engineers aren't boring people, but they got excited over boring things and they make it fun.
www.freewebs.com/gpkfontys

User avatar
Robomaniac
Hobgoblin
Posts: 508
Joined: Tue Feb 03, 2004 6:39 am

Post by Robomaniac » Sat Apr 23, 2005 3:48 pm

There is a conflict with the xerces memory manager and the ogre memory manager, simply wrap all of your cegui includes with #define OGRE_NO_MEMORY_MACROS and after #define OGRE_MEMORY_MACROS

(I think)
0 x
phear hingo

My Webpage

User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
Contact:

Post by haffax » Sat Apr 23, 2005 3:50 pm

almost ;)

Code: Select all

#include <OgreNoMemoryMacros.h>
// XERCES/CEGUI headers
#include <OgreMemoryMacros.h>
0 x
team-pantheon programmer
creators of Rastullahs Lockenpracht

User avatar
darkmaster
Halfling
Posts: 67
Joined: Wed Mar 09, 2005 7:04 pm
Location: Netherland

Post by darkmaster » Sun Apr 24, 2005 11:04 am

:D Niceee solution. Its working correctly now guys.

but why do we need to include<OgreNoMemoryMacros>
and include<OgreMemoryMacros>.

HOw is the workaround regarding to the memoryManager conflict be done with this statement? maybe someone can explain to me :wink:


Dark
0 x
Engineers aren't boring people, but they got excited over boring things and they make it fun.
www.freewebs.com/gpkfontys

User avatar
Kencho
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4011
Joined: Fri Sep 19, 2003 6:28 pm
Location: Burgos, Spain
x 1
Contact:

Post by Kencho » Sun Apr 24, 2005 12:04 pm

Haven't looked into this, but I guess it has something to deal with #undef and #define preprocessor statements and things like that ;)
0 x
Image

User avatar
bal
Greenskin
Posts: 100
Joined: Thu Dec 09, 2004 7:29 pm
Location: Geluwe, Belgium

Post by bal » Sun Apr 24, 2005 5:31 pm

Ogre's memory manager conflicts with Xerces' one.
0 x

User avatar
:wumpus:
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 3067
Joined: Tue Feb 10, 2004 12:53 pm
Location: The Netherlands

Post by :wumpus: » Sun Apr 24, 2005 5:35 pm

I generally see Ogre's memory manager as a pita and disable it completely even in debug mode; although it's very nice if you want to detect leaks, it redefining the allocation/deallocation functions doesn't go to well with most if third party dependency, even Xerces and CEGUI.
0 x

User avatar
Kencho
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4011
Joined: Fri Sep 19, 2003 6:28 pm
Location: Burgos, Spain
x 1
Contact:

Post by Kencho » Sun Apr 24, 2005 5:40 pm

Nice observation. Now that you mention it, I think I'll enable it only for the debug build ;)
0 x
Image

User avatar
:wumpus:
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 3067
Joined: Tue Feb 10, 2004 12:53 pm
Location: The Netherlands

Post by :wumpus: » Sun Apr 24, 2005 5:45 pm

It is only enabled for debug builds by default.. :-)
0 x

User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
Contact:

Post by haffax » Sun Apr 24, 2005 6:22 pm

That was Kencho's point. ;)
0 x
team-pantheon programmer
creators of Rastullahs Lockenpracht

User avatar
Kencho
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4011
Joined: Fri Sep 19, 2003 6:28 pm
Location: Burgos, Spain
x 1
Contact:

Post by Kencho » Sun Apr 24, 2005 6:27 pm

LOL You're right! :lol: I've won the "stupid comment of the month" prize, hahahaha!!!
0 x
Image

Post Reply