Skip to main content

History: Codeblocks and MinGW

Preview of version: 3

{IMG(src="http://localhost/img/wiki_up/CBsplash.jpg"}<font size="+2">Using Ogre with Code::Blocks + MinGW C++ Toolbox</font>
<br style="clear: both;">
FORCETOC

Download the SDK


Ogre 1.4.0 SDK for Code::Blocks + MingW









Ogre 1.2.5 SDK for Code::Blocks + MingW










MingW will statically link libstdc++ (the library portion, not the STL) to each build ie each dll or exe. This creates a problem when passing strings and any stream types across dll's. Because the static linking has each copy of libstdc++ managing its own strings and streams, passing a string/stream to another dll and then having it modified there will trash memory. Ogre has several dll's and does pass strings and streams around. Do a debug build of Ogre with libstdc++ and then run in gdb and you find out quickly that a crash occurs in OgrePlatform_d.dll after the config window closes when it tries to modify/deallocate a string passed to it from OgreMain.dll.

A release build using libstdc++ "seems" to run fine for simple Ogre demos but if you start passing a lot of Ogre strings across dll's in a more complicated app, the app starts to misbehave after a while and crashes occur.

libstdc++ was rebuilt with the configure option --enable-fully-dynamic-string so that strings are dynamically allocated using the RTL and can be passed across the dll boundry.


wchar, wstring and wide streams for unicode support don't work in the standard pre-built libstdc++ that comes with g++ 3.4.5. libstdc++ was rebuilt with wchar, wstring and wide stream to support wide strings so that Ogre 1.4.x could be built.





The Ogre SDK comes with:

  • all the Ogre modules built for you ie the dll's and static archives
  • the Ogre manual in HTML format
  • API reference in the form of a windows compiled help (.chm)
  • All header files (*.h) for the libs/dll are included
  • Source code and project files for 30 demos that you can compile and run as a confidence test of the SDK installation and to see what Ogre can do.
  • All media resources required for demos
    • Material Scripts + shader programs
    • Compositor Scripts
    • Particle Scripts
    • Meshes + Animations
    • Textures



What you need to provide that is not supplied in the SDK

The SDK was built and tested with the following:

MinGW C++ Toolbox



Download the MinGW C++ Toolbox provided on the Ogre SF files site. MinGW must be setup before running Code::Blocks for the first time to make detection of MinGW go smoothly.

Download the installer package which will install the following in your mingw directory ie c:\mingw.





MinGW Toolbox Install Guide



Read the MinGW Toolbox Install Guide before running the toolbox installer.





Code::Blocks



There is an official release of Code::Blocks as of February 2008. This supersedes the previous release candidate, which even the
Code::Blocks team didn't recommend anyway. For the longest time, to use Code::Blocks you had to have a nightly build of the development trunk,
certainly so if you wanted to compile OGRE. If you have used release candidate RC2 or one of the pre-release nghtly builds, do get the
new official release instead! In any case, the build files supplied with OGRE will not work with the old release candidate.



Check Code::Blocks + MinGW installation

Make sure that Code::Blocks found your MinGW C++ Toolbox installation by following these instructions here: Code Blocks Compiler Setup





DirectX 9.0c August 2006 edition


  • <font size="+1">Download the SDK</font>. You will need the DirectX SDK if you plan to build and run in debug mode when using Direct3D9 Rendering mode. If you plan on building Ogre from source at a later date then you will need the DirectX SDK also. Note that this SDK doesnt work on Windows 2000 or less.


Note: You do not need to download the dependencies package for Code::Blocks+MingW, everything you need is included in the SDK.




The Ogre Core libraries and plugins:


CB_SetC_D.jpg

In the settings menu select Compiler and Debugger to setup the directories.



CB_CompilerDir.jpg

Setup the include directories for the compiler.



CB_LinkerDir.jpg

Setup the lib directories for the linker. Note that DirectX SDK lib is not used. The import libs in the Ogre dependencies will be used instead since MingW cannot link directly to the libs provided in the DirectX SDK.



CB_ResDir.jpg

Include directory for windows resource compiler.





To build Ogre in Code::Blocks, open the Ogre.workspace file. If you have installed or are using Code::Blocks + MinGW + STLPort, open the Ogre_stlp.workspace file.

CB_BuildWorkspace.jpg

In the build menu select Build Workspace. This will build the debug and release targets of all projects listed in the workspace manager window.

The build process will take about 30 minutes on a AMD Athlon XP 2000+ with 512Megs if all projects are built.

You will (hopefully) find the newly build sample demos under:

  • ogrenew\Samples\Common\bin\Debug
  • ogrenew\Samples\Common\bin\Release



<u>Building Ogre Core DLLs</u>

If you don't want to build the samples choose Save Workspace as... under the file menu, enter OgreCore_stlp.workspace for the file name and save. Next, close the samples and projects in the workspace that you don't want, and save again. You can use the OgreCore_stlp workspace to re-build Ogre each time you update from CVS.

Here is an example of the minimum Ogre Core DLLs that must be built for the SDK. This assumes that you are utilizing the BSP and Octree scenemanagers, both DirectX and OpenGL renderers, CG shaders, and CEGUI.

CB_OgreCoreWS.jpg

Note: Code::Blocks builds the projects in the order listed in the Manager window. Dependencies have been set up to insure that if you decide to build a demo before the core libraries, the core library projects will be built first.

CodeBlocks Ogre SDK Tips

CodeBlocks MinGW FAQ

Category:Setup
Category:Code Blocks

History

Information Version
Thu 23 of Sep, 2010 23:23 GMT-0000 Beauty added page alias name 36
Mon 04 of Jan, 2010 13:53 GMT-0000 jacmoe 35
Wed 30 of Dec, 2009 05:28 GMT-0000 jacmoe 34
Wed 30 of Dec, 2009 05:10 GMT-0000 jacmoe 33
Wed 30 of Dec, 2009 05:07 GMT-0000 jacmoe 32
Wed 30 of Dec, 2009 04:57 GMT-0000 jacmoe 31
Wed 30 of Dec, 2009 04:54 GMT-0000 jacmoe 30
Wed 30 of Dec, 2009 04:53 GMT-0000 jacmoe 29
Wed 30 of Dec, 2009 04:50 GMT-0000 jacmoe 28
Wed 30 of Dec, 2009 04:48 GMT-0000 jacmoe 27
Wed 30 of Dec, 2009 04:30 GMT-0000 jacmoe 26
Wed 30 of Dec, 2009 04:30 GMT-0000 jacmoe 25
Wed 30 of Dec, 2009 04:28 GMT-0000 jacmoe 24
Wed 30 of Dec, 2009 04:27 GMT-0000 jacmoe 23
Wed 30 of Dec, 2009 04:21 GMT-0000 jacmoe 22
Sat 26 of Dec, 2009 23:58 GMT-0000 jacmoe 21
Sat 26 of Dec, 2009 23:55 GMT-0000 jacmoe 20
Sat 26 of Dec, 2009 23:46 GMT-0000 jacmoe 19
Sat 26 of Dec, 2009 23:45 GMT-0000 jacmoe 18
Sat 26 of Dec, 2009 23:37 GMT-0000 jacmoe 17
Sat 26 of Dec, 2009 23:33 GMT-0000 jacmoe 16
Fri 18 of Dec, 2009 18:51 GMT-0000 jacmoe 15
Fri 18 of Dec, 2009 18:45 GMT-0000 jacmoe 14
Fri 18 of Dec, 2009 18:44 GMT-0000 jacmoe 13
Fri 18 of Dec, 2009 18:43 GMT-0000 jacmoe 12
  • «
  • 1 (current)
  • 2