Trouble compiling my Ogre app with CEGUI

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

User avatar
Walley
Just popping in
Just popping in
Posts: 4
Joined: Wed Jan 12, 2005 12:06

Trouble compiling my Ogre app with CEGUI

Postby Walley » Thu Dec 30, 2004 12:00

In my Ogre application, I'm merely including "CEGUI.h" and "ogrerender.h" from CEGUI at the moment, as well as using one function (which is not the source of the problem).
I was able to get this compiling and running fine in Release mode with the latest stable release, but in Debug mode I got assertions etc :\.

I'm now using the latest version of CEGUI from CVS, as I was told the assertion problems were fixed with it. However, it generates numerous errors (show in the build log below).

I searched through the forums, and tried a number of the relevant suggestions - I currently have Ogre Debug compiled without the debug scene manager, and have also made sure that "CEGUI.h" (and "ogrerender.h") is included before "Ogre.h" is anywhere.


Any help would be appreciated.

The build log is as follows:

[size=7:6ca6606d15]
------ Build started: Project: Base, Configuration: Debug Win32 ------

Compiling...
State_TestBed.cpp
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\malloc.h(113) : error C2143: syntax error : missing ';' before '.'
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\malloc.h(113) : warning C4229: anachronism used : modifiers on data are ignored
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\malloc.h(113) : error C2720: 'Ogre::MemoryManager::sMemManager' : 'Ogre::MemoryManager::' storage-class specifier illegal on members
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\malloc.h(113) : error C2491: 'Ogre::MemoryManager::sMemManager' : definition of dllimport static data member not allowed
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\malloc.h(114) : error C2143: syntax error : missing ';' before '.'
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\malloc.h(114) : warning C4229: anachronism used : modifiers on data are ignored
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\malloc.h(114) : error C2720: 'Ogre::MemoryManager::sMemManager' : 'Ogre::MemoryManager::' storage-class specifier illegal on members
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\malloc.h(114) : error C2182: 'sMemManager' : illegal use of type 'void'
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\malloc.h(114) : error C2491: 'Ogre::MemoryManager::sMemManager' : definition of dllimport static data member not allowed
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\malloc.h(115) : error C2143: syntax error : missing ';' before '.'
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\malloc.h(115) : warning C4229: anachronism used : modifiers on data are ignored
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\malloc.h(115) : error C2720: 'Ogre::MemoryManager::sMemManager' : 'Ogre::MemoryManager::' storage-class specifier illegal on members
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\malloc.h(115) : error C2491: 'Ogre::MemoryManager::sMemManager' : definition of dllimport static data member not allowed
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\malloc.h(116) : error C2143: syntax error : missing ';' before '.'
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\malloc.h(116) : warning C4229: anachronism used : modifiers on data are ignored
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\malloc.h(116) : error C2720: 'Ogre::MemoryManager::sMemManager' : 'Ogre::MemoryManager::' storage-class specifier illegal on members
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\malloc.h(116) : error C2491: 'Ogre::MemoryManager::sMemManager' : definition of dllimport static data member not allowed
Generating Code...
Compiling...
StateEngine.cpp
Generating Code...
Compiling...
WinMain.cpp
c:\Daniel's Folder\c++\Ogre3D\CEGUI\cegui_mk2 cvs\include\CEGUIString.h(1248) : error C2589: '(' : illegal token on right side of '::'
c:\Daniel's Folder\c++\Ogre3D\CEGUI\cegui_mk2 cvs\include\CEGUIString.h(1248) : error C2059: syntax error : '::'
c:\Daniel's Folder\c++\Ogre3D\ogre 0-15-1\OgreMain\include\OgreHardwareVertexBuffer.h(61) : fatal error C1903: unable to recover from previous error(s); stopping compilation
Generating Code...

Build log was saved at "file://c:\Daniel's Folder\c++\Ogre3D\Projects\Base\Debug\BuildLog.htm"
Base - 16 error(s), 4 warning(s)
[/size:6ca6606d15]

User avatar
Walley
Just popping in
Just popping in
Posts: 4
Joined: Wed Jan 12, 2005 12:06

Trouble compiling my Ogre app with CEGUI

Postby Walley » Fri Dec 31, 2004 00:33

Ok, I managed to get around that by using #undef max and #undef min.
However, now when I compile I get the same problem I was getting with the previous CEGUI and Ogre - in Debug Mode I get ms_Singleton Assertion failed upon calling
CEGUI::Renderer* renderer = CEGUI::System::getSingleton().getRenderer();
however, in Release mode there is no such problem :\
As mentioned above, I've compiled Ogre Debug with the debug memory manager disabled :\

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Trouble compiling my Ogre app with CEGUI

Postby CrazyEddie » Sun Jan 02, 2005 11:35

Since release mode is working, the 'obvious' question of whether you're instantiating CEGUI::System is answered ;) So, I think I'll have to look into this a little - though I have not seen this issue here.

Is there anything (errors) in the CEGUI.log file?

User avatar
Walley
Just popping in
Just popping in
Posts: 4
Joined: Wed Jan 12, 2005 12:06

Trouble compiling my Ogre app with CEGUI

Postby Walley » Sun Jan 02, 2005 23:43

In my additional ignorance I also forgot to log in 8O.

Anyways, is CEGUI set to generate a log by default?
As it's not :\

I tried 'Logger::getSingleton().setLoggingLevel(Informative);' (saw that in one of the demos), but even it generates an assertion so I can't get a log ^.^.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Trouble compiling my Ogre app with CEGUI

Postby CrazyEddie » Wed Jan 05, 2005 19:15

Yes, a log is always generated once the base system is up and running. In this case it seems that none of the core library singletons are being created. What happens when you trace into the contructor for the System object? Are the lines:

Code: Select all

   // cause creation of other singleton objects
   new ImagesetManager();
   new FontManager();
   new WindowFactoryManager();
   new WindowManager();
   new SchemeManager();
   new MouseCursor();


being executed?

CE.

User avatar
Walley
Just popping in
Just popping in
Posts: 4
Joined: Wed Jan 12, 2005 12:06

Trouble compiling my Ogre app with CEGUI

Postby Walley » Thu Jan 06, 2005 00:19

How embarassing - I think the problem was that I was never calling:

Code: Select all

mGUIRenderer = new CEGUI::OgreRenderer(mWindow, Ogre::RENDER_QUEUE_OVERLAY, false, 3000);
   new CEGUI::System(mGUIRenderer);


And initializing the system :\
The fact it worked (?!) in Release mode made me think that what I was currently doing was fine :\

Lol ^.^

Oh well, I'll learn from that mistake :\

In case I'm mistaken I'll put CEGUI back into my project and see how it goes.

PS. It'd be cool if I could like... erase this post from everyone's memory :P

User avatar
spannerman
Home away from home
Home away from home
Posts: 330
Joined: Wed Jan 12, 2005 12:06

Trouble compiling my Ogre app with CEGUI

Postby spannerman » Thu Jan 06, 2005 13:36

Hehe no one is immune from making silly mistakes from time to time.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Trouble compiling my Ogre app with CEGUI

Postby CrazyEddie » Thu Jan 06, 2005 19:19

:lol:

These things do happen to the best of us. I have a very long list of silly things I've done before; all things that once the mistake is known, I can't believe that I did it in the first place :)

CE.

User avatar
paddy
Not too shy to talk
Not too shy to talk
Posts: 30
Joined: Wed Jan 12, 2005 12:06

Re: Trouble compiling my Ogre app with CEGUI

Postby paddy » Mon Jan 24, 2005 04:34

I am having this exact problem with

c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\malloc.h(113) : error C2143: syntax error : missing ';' before '.'


occuring, I get about 17 of these.

where do you do the #undef min and #undef max to get this problem to resolve? I tried adding them but couldn't seem to get it to compile still.

thanks much :D

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Trouble compiling my Ogre app with CEGUI

Postby CrazyEddie » Mon Jan 24, 2005 09:52

the #undef directives for min/max go after any Win32/DirectX include, so group all those together and just do the undefs once afterwards.

I'm not certain if this is your problem though; I'd be more inclined to guess it's an issue with memory managers. If it does turn out to be the memory manager issue, you must either ensure that the CEGUI includes appear before Ogre includes (and the include for the Ogre GUI renderer), or surround your CEGUI includes with includes of the OgreNoMemoryMacros.h / OgreMemoryMacros.h files. Just to reiterate an important point here - the OgreRenderer.h should also appear after all other CEGUI includes as it includes Ogre.h.

HTH

CE.

User avatar
paddy
Not too shy to talk
Not too shy to talk
Posts: 30
Joined: Wed Jan 12, 2005 12:06

Re: Trouble compiling my Ogre app with CEGUI

Postby paddy » Tue Jan 25, 2005 03:01

Wow you got it. I'd never guess a syntax error in malloc would be due to the order of headers, but that fixed it perfectly.


Thanks again :D


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 15 guests