Compiling with CodeBlocks + mingw

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
steven
Not too shy to talk
Not too shy to talk
Posts: 26
Joined: Mon Jul 04, 2005 18:38

Compiling with CodeBlocks + mingw

Postby steven » Tue Dec 20, 2005 19:47

Hello,


[EDIT] 10 feb 06 - With the new forum the CB files are not attached anymore ! I asked crazyeddy to add the files to the cvs[/EDIT].

This topic is to help people compile CEGUI with Mingw + Codeblocks.

I managed to compile all .dll and .exe (except DX8, Irrlicht which I don't need). 8)

In the attachement are the CB files, which must be unziped in the root cegui directory. These CB files contains debug and release projects.



[EDIT 18 Jan 06] The CB files were updated (v0.4). The OpenGl, DX9, DX8 and Ogre renderer are working ![/EDIT]


READ THE README : It explains which source files must be modified and optional build options.



Now the catch... The samples exe don't work! [EDIT]Now they work :)[/EDIT]

I am able to build and run Ogre in its opengl and directx version. But there is something really strange with the cegui libraries included : opengl, directx and ogre.

I need to know which library version are needed.
Please: Don't tell me those for VisualC it's not useful I need those for mingw.

If someone is able to compile with mingw and run the samples, I would be really happy to know what is missing.


I hope this will help someone...
Bye
Last edited by steven on Fri Feb 10, 2006 14:43, edited 2 times in total.

User avatar
WhiteKnight
Just popping in
Just popping in
Posts: 12
Joined: Sat Nov 19, 2005 12:53

Re: Compling with CodeBlocks + mingw

Postby WhiteKnight » Fri Dec 30, 2005 10:21

Its nice to see someone working on Code::Blocks and mingw :). How come nobody submits a patch though? I'm keen to submit one if nobody beats me to it.

There are some problems with your project files. Firstly you use copy for the post build steps, but by default Code::Block project should use cp. Second the reason lua_and_tolua++ and CEGUILua aren't compiling is because the files's paths start with '..\..\..\..\..\ScriptingModules' instead of '..\..\..\..\ScriptingModules'. Also the lua_and_tolua++ and CEGUILua output filenames also have one '..\' too many.

Keep up the good work.

User avatar
steven
Not too shy to talk
Not too shy to talk
Posts: 26
Joined: Mon Jul 04, 2005 18:38

Re: Compling with CodeBlocks + mingw

Postby steven » Fri Dec 30, 2005 19:27

How come nobody submits a patch though? I'm keen to submit one if nobody beats me to it.

Do it, please.

In the README I tried to put all the source that must be modified. But perhaps I missed some #define in some .h files.

I hope that a CEGUI developer could try to compile it with Codeblocks to determine if something is missing. It should be easy now. :D

... you use copy for the post build steps, but by default Code::Block project should use cp.

You are right, sorry. I had one time a issue with the codeblock cp so i copied the win copy.exe.

Second the reason lua_and_tolua++ and CEGUILua aren't compiling is because the files's paths start with '..\..\..\..\..\ScriptingModules' instead of '..\..\..\..\ScriptingModules'. Also the lua_and_tolua++ and CEGUILua output filenames also have one '..\' too many.

Right. I corrected it and it seems to compile correctly. Thanks.

I provide below the modified CB files.

Keep up the good work.

Thanks.

BTW, did you succed to run the samples ?
If yes, could you please tell which versions of the GL, DX9 you used? Did you use only the mingw lib?

I still have an issue with the DX9 library. When I try to run any samples it gives me :

Code: Select all

 DX9 debug -> missing dxerr9ab.dll  !?
 DX9 release -> missing entry point _ZN5CEGUIpIENS_6StringEPKc in ceguibase.dll


Any idea ?

Bye

User avatar
SOMRoberto
Just popping in
Just popping in
Posts: 20
Joined: Sat Dec 31, 2005 21:08
Contact:

Re: Compling with CodeBlocks + mingw

Postby SOMRoberto » Sat Dec 31, 2005 21:12

U forgotten said depencies: cegui depencies and ogre headers and ogremain lib etc. ;)

User avatar
steven
Not too shy to talk
Not too shy to talk
Posts: 26
Joined: Mon Jul 04, 2005 18:38

Re: Compling with CodeBlocks + mingw

Postby steven » Sun Jan 01, 2006 12:46

U forgotten said depencies: cegui depencies and ogre headers and ogremain lib etc. ;)

Well... yes and no. I understand the errors messages I didn't understand WHY i had them.

Anyway I found the reasons of most of my problems, I reused the dependencies for cegui 0.3.0 and I had a mix of DX9c and DX9ab versions... !? I don't remember why I did that!

The libDxErr9.a was from DX9ab and will not work with my system DX9c dll. If I simply remove this .a and let CB use the libDxErr9.a provided with CB (w32api-3.2.tar.gz) it works perfectly.


Now the debug version is working but the release has still a problem :

ceguibase.dll, .a and .def where build at the same time (of course) they contain the entry point :
_ZN5CEGUIplERKNS_6StringEPKc @2312 entry in the ceguibase .a, .def and .dll.
But the exe samples are calling _ZN5CEGUIplENS_6StringEPKc

For now, I don't understand this mismatch. But I will.


PS : I now use codeblocks-dependencies-1.0.1.zip you must remove all references to the "old" cegui.

User avatar
steven
Not too shy to talk
Not too shy to talk
Posts: 26
Joined: Mon Jul 04, 2005 18:38

Re: Compling with CodeBlocks + mingw

Postby steven » Sun Jan 01, 2006 17:46

YES !!

The samples are working with OpenGl and DirectX9 in debug and release :D


I provide the updated CB files below.

CAREFUL : you MUST read the README !

The OpenGl version is a bit a hack and I hope
that someone can give me a better solution.



However, the Ogre version is still not working. :(

I am trying to build against Ogre 1.0.5 but I read some threads that say cegui 0.4.1 is not compatible with ogre version < 1.0.6.
Is this true ? If not, did someone build and run against ogre 1.0.5 (with mingw) ?

Bye

User avatar
SOMRoberto
Just popping in
Just popping in
Posts: 20
Joined: Sat Dec 31, 2005 21:08
Contact:

Re: Compling with CodeBlocks + mingw

Postby SOMRoberto » Mon Jan 02, 2006 12:38

I got some warning: ../../../../include/CEGUILogger.h:159: warning: base class `class CEGUI::Singleton<CEGUI::Logger>' should be explicitly initialized in the copy constructor
../../../../include/CEGUIWindow.h:3931: warning: base class `class CEGUI::PropertySet' should be explicitly initialized in the copy constructor
../../../../include/CEGUIWindow.h:3931: warning: base class `class CEGUI::EventSet' should be explicitly initialized in the copy
..........
etc.

and error:
cannot find -lfreetype.dll

I compiling cegui 0.4.0 for Crystal Space.

User avatar
SOMRoberto
Just popping in
Just popping in
Posts: 20
Joined: Sat Dec 31, 2005 21:08
Contact:

Re: Compling with CodeBlocks + mingw

Postby SOMRoberto » Mon Jan 02, 2006 14:37

I got some warning: ../../../../include/CEGUILogger.h:159: warning: base class `class CEGUI::Singleton<CEGUI::Logger>' should be explicitly initialized in the copy constructor
../../../../include/CEGUIWindow.h:3931: warning: base class `class CEGUI:ropertySet' should be explicitly initialized in the copy constructor
../../../../include/CEGUIWindow.h:3931: warning: base class `class CEGUI::EventSet' should be explicitly initialized in the copy
..........
etc.

I compiling cegui 0.4.0 for Crystal Space. 8)

User avatar
steven
Not too shy to talk
Not too shy to talk
Posts: 26
Joined: Mon Jul 04, 2005 18:38

Re: Compling with CodeBlocks + mingw

Postby steven » Mon Jan 02, 2006 20:16

SOMRoberto wrote:
I got some warning: ....

Yes. Those 3 warnings are the most annoying but they are not the only ones.

This is one of the reason I hope a CEGUI programer will try to compile cegui with gcc (mingw). ;)

I compiling cegui 0.4.0 for Crystal Space. 8)

Nice.

User avatar
SOMRoberto
Just popping in
Just popping in
Posts: 20
Joined: Sat Dec 31, 2005 21:08
Contact:

Re: Compling with CodeBlocks + mingw

Postby SOMRoberto » Tue Jan 03, 2006 10:54

CEGUI compiling is perfectly with code::blocks project. :P :P :P

User avatar
WhiteKnight
Just popping in
Just popping in
Posts: 12
Joined: Sat Nov 19, 2005 12:53

Re: Compling with CodeBlocks + mingw

Postby WhiteKnight » Thu Jan 05, 2006 17:24

steven, I see in your readme file you say: "MINGW, __MINGW__ = compiler mingw", but then in your changes to files you use __MINGW32__. It seems that __MINGW32__ is defined by the compiler and therefore is the correct one to use. Also you've changed throw std::exception to throw String, but not the 3 catch std::exception. Also you might want to define the Execution working directory for all demos and for consistency you might want to change lua_and_tolua++'s Objects output directory to use Output as well.

I'm trying to compile OGRE's Dagon version using cegui built with MSYS and haven't succeeded in building cegui with MSYS yet. I have compiled cegui using your project file for Code::Blocks, but when I run a sample I get the dialog box to select a renderer, but once I select OGRE I get an exception saying the the entry point couldn't be found. Though OGRE's Demo_GUI works fine.

User avatar
steven
Not too shy to talk
Not too shy to talk
Posts: 26
Joined: Mon Jul 04, 2005 18:38

Re: Compling with CodeBlocks + mingw

Postby steven » Thu Jan 05, 2006 20:11

WhiteKnight wrote:
steven, I see in your readme file you say: "MINGW, __MINGW__ = compiler mingw", but then in your changes to files you use __MINGW32__. It seems that __MINGW32__ is defined by the compiler and therefore is the correct one to use.

Yes you are right.

Also you've changed throw std::exception to throw String, but not the 3 catch std::exception.

Can you show me where you want to make the changes?

Also you might want to define the Execution working directory for all demos and for consistency you might want to change lua_and_tolua++'s Objects output directory to use Output as well.

You are right. I missed some changes during all those copy/select project options/paste/save/ok.

... but once I select OGRE I get an exception saying the the entry point couldn't be found. Though OGRE's Demo_GUI works fine.

I have the same entry point exception for the Ogre renderer... arghh! As I didn't try to compile CEGui 0.3.0 with mingw, I don't know if it's due either by a change from CEGui 0.3.0 to 0.4.0 or from mingw.

When we succed I will make a new version of the CB files.

Bye

User avatar
WhiteKnight
Just popping in
Just popping in
Posts: 12
Joined: Sat Nov 19, 2005 12:53

Re: Compling with CodeBlocks + mingw

Postby WhiteKnight » Sat Jan 07, 2006 00:00

I've been following the changes dermont used for cegui 0.4 and so the compiler didn't see dllexport :oops:. I almost submitted a patch with those changes, but then decided to investigate into why those changes where made and came to the same conclusion you must have come to. If only I'd looked at your patch more carefully I'd have saved myself a lot of time.

Now the samples don't give me that entry point error, but now OGRE's memory manager causes the samples to crash :(.

The three std::exception catches are: CEGuiSample.cpp line 116 and src/renderers/directx81GUIRenderer/renderer.cpp line 68 and 659. Code::Blocks' find in files will find them.

User avatar
WhiteKnight
Just popping in
Just popping in
Posts: 12
Joined: Sat Nov 19, 2005 12:53

Re: Compling with CodeBlocks + mingw

Postby WhiteKnight » Sat Jan 07, 2006 08:01

BTW the DirectX and OpenGL renderers work fine.

User avatar
steven
Not too shy to talk
Not too shy to talk
Posts: 26
Joined: Mon Jul 04, 2005 18:38

Re: Compling with CodeBlocks + mingw

Postby steven » Sat Jan 07, 2006 20:11

WhiteKnight wrote:
Now the samples don't give me that entry point error, but now OGRE's memory manager causes the samples to crash :(.

There are two ways to deal with the OgreMemoryManager :

- First, you can use #include "OgreNoMemoryMacros.h" and #include "OgreMemoryMacros.h". You will need to try where to put them exactly. Tell me if you find. (This is the method used by Sinbad when he has problem with librares).

- Second, more radical, this is the method I adopted. Set in the file "OgreConfig.h" the line :

#define OGRE_DEBUG_MEMORY_MANAGER 1
to
#define OGRE_DEBUG_MEMORY_MANAGER 0

and recompile completely Ogre ! This will remove the ogre debug version memory manager from ALL ogre code. This is appropriate only if you have problem with the debug version not the relase version.

The second permitted me to compile CEGui for Ogre. 8)



But I still have this "entry point error" :evil:

The exe is trying to call _ZN5CEGUIplENS_6StringEPKc but
ceguibase.dll, .a and .def contain only the entry point :
_ZN5CEGUIplERKNS_6StringEPKc @2312.

I really don't understand this. :evil:


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 4 guests