Skip to main content

History: CodeBlocks MinGW FAQ

Source of version: 6 (current)

Copy to clipboard
            %prevogre%
{DIV(class="Layout_box1")}{SPLIT(colsize=15%|85%)}{img src="img/wiki_up/CBsplash.jpg" alt="CBsplash.jpg"}---
{DIV(class="bigBold")}FAQ for Ogre SDK Code::Blocks + MingW + STLPort{DIV}{SPLIT}{DIV}

{maketoc}

!Can I use MinGW gcc versions older than gcc 3.4.5?

The short and simple answer is __NO__.

The long answer is an excerpt from the MinGW gcc 3.4.5 release notes:
{DIV(class="Layout_box2")} This release also incorporates a patch to fix a bug in the (undocumented
 and win32-specific) feature of allowing exceptions to cross dll-exe
 boundaries. The patch changes the structure used to share pointers to
 global exception data and so introduces an ABI-incompatibility with
 earlier gcc-3.4.x releases. This means that for C++ code that needs to
 throw exceptions across dll boundaries, both exe and dll must be
 compiled with the same version of gcc.{DIV}

An example is Dev-cpp which installs MinGW gcc 3.4.2. gcc 3.4.2 is not compatible with 3.4.5 builds when exceptions are being used. Ogre is made up of many dlls and does throw exceptions across dll boundaries.

See ((CodeBlocks MingW STLPort|#What you need to provide that is not supplied in the SDK|required Mingw Packages))

!Can I use the MinGW version that comes with Dev-Cpp?
The short and simple answer is __NO__.

See section above.

Also, the ld.exe that comes with Dev-cpp is very old and does not support linking directly to dll files. You must use binutils-2.16.91-20060119-1 or later.

!Why do I get Link error: cannot find -lOgreMain __OR__ Link error: cannot find -lOgreMain_d ?
During the link stage you get a link error message that -lOgreMain_d or -lOgreMain could not be found. If this occured just after installing Code::Blocks and building the Ogre demos then check the ((Code Blocks Compiler Setup)).

If the Ogre samples build ok and you are getting the link error message when building your own app then check that the linker directory paths in the project target build options has an entry for where OgreMain.dll(Release build) or OgreMain_d.dll(Debug build) can be found. They should be in your bin\release(debug) directory.

!Why use STLPort instead of libstdc++ v3 that comes with MingW?
read ((CodeBlocks MingW STLPort|#Why use STLPort instead of libstdc.2B.2B v3 that comes with MingW.3F|'''this'''))

==> DEPRECATED! Better read ((Codeblocks and MinGW|__this__)) !