CodeBlocks compilation error ( SOLVED )

Alberto Rubinato

30-08-2006 15:13:49

Hi,
I'm tryng to compile OgreOde with Code::Blocks. I'm using nightly build.

I've no problem to compile my own Ogre application, but with OgreOde, i've got some trouble.

1) I've imported VC8 solution.
2) I've compiled Ode project without any problem.
3) During compilation of OgreOde project I've this error

-------------- Build: Debug|Win32 in OgreOde_Core ---------------
Compiling: ..\..\src\OgreOdeBody.cpp
In file included from ../../include/OgrePrerequisites.h:82,
from ../../include/Ogre.h:28,
from ../../include/OgreOdePreReqs.h:4,
from ../../include/OgreOdeWorld.h:4,
from ..\..\src\OgreOdeBody.cpp:1:
../../include/OgreMemoryManager.h:98: error: declaration of `void* operator new(size_t)' throws different exceptions
C:/CodeBlocks/include/c++/3.4.5/../3.4.5/new:82: error: than previous declaration `void* operator new(size_t) throw (std::bad_alloc)'
../../include/OgreMemoryManager.h:99: error: declaration of `void* operator new [](size_t)' throws different exceptions
C:/CodeBlocks/include/c++/3.4.5/../3.4.5/new:83: error: than previous declaration `void* operator new [](size_t) throw (std::bad_alloc)'
../../include/OgreMemoryManager.h:100: error: declaration of `void operator delete(void*)' throws different exceptions
C:/CodeBlocks/include/c++/3.4.5/../3.4.5/new:84: error: than previous declaration `void operator delete(void*) throw ()'
../../include/OgreMemoryManager.h:101: error: declaration of `void operator delete [](void*)' throws different exceptions
C:/CodeBlocks/include/c++/3.4.5/../3.4.5/new:85: error: than previous declaration `void operator delete [](void*) throw ()'
Process terminated with status 1 (0 minutes, 7 seconds)
8 errors, 0 warnings

I've searched in the main forum for similar error, but nothing.

Theese are the project parameter i'm using

OgreOde_Core

Linker -> Other linker options:
-Wl,--enable-runtime-pseudo-reloc
-Wl,--enable-auto-image-base
-Wl,--add-stdcall-alias

Compiler -> other options ( taken from wiki )
-mthreads
-fmessage-length=0
-fexceptions
-fident

Debug|Win32 profile

Compiler -> #defines
_DEBUG
_STLP_DEBUG
OGREODE_EXPORTS
WIN32
_WINDOWS
_USRDLL

I'm linking with

ode
libode.a
Ogremain_d
stlportstlg.5.0

Stport include directory entry in before base c++ include directory entry as indicated in ogre wiki for Code::Blocks application build.

Thanks in advance for any suggestion.

Alberto Rubinato

tuan kuranes

30-08-2006 15:35:49

It's a problem with Ogre Debug Memory manager.
Ode need that manager to be off, that why every ode.h is surrounded by

#include "OgreNoMemoryMacros.h"
#include "ode.h"
#include "OgreMemoryMacros.h"

Seems that's causing a problem with code blocks.
Look for help about that +cb on main forum.

Alberto Rubinato

30-08-2006 17:53:26

Hi,

I've found this solution

http://www.ogre3d.org/phpBB2/viewtopic. ... 058#172058.

Other compilation issues are the following:

I'm using OgreSDK that has his ODE in include folder. So I've got pushed up ../../ode/include directory before $(OGRE_HOME)/include in order to solve compilation problem.

Added compiler options described in Wiki for Code::Blocks ( http://www.ogre3d.org/wiki/index.php/Se ... TLPort_5.0 ).

Added Stlport library in link section ( infact MS VC++ 8 not need it ).

Still remain post compilation error for target files copy. I've copied them manually in bin debug/release folder.

I hope theese infos can be useful to someone.

Alberto Rubinato

tuan kuranes

30-08-2006 18:05:59

Thanks for Sharing.

If you send me codeblock workspace and project files, I'll add them to CVS / zip pack.

Alberto Rubinato

30-08-2006 18:58:59

Ok.
I'm completing conversion and after I'll send you them.

Alberto Rubinato

Alberto Rubinato

30-08-2006 23:47:46

Okay, Iìm ready for shiping files.
I've tryed to send you to the mail links, but I've received a network error.

Have you got another mail address?

The zip file that I've produced is very small ( 12 Kb ).

In any case I've shared it at

http://www.sharebigfile.com/file/3186/ogreode.zip.html

I also report you the text of the e-mail

----------------------------------------------

Hi tuan kuranes,
I'm Alberto Rubinato. As you have requested on OgreOde Addons Forum, I'm sending you all Code::Blocks projects and solution.

I've tested both Debug and Release target profiles.

As indicated in the topic on the forum it only compiles if standard STL c++ path directory are not defined in the compiler settings.

I've also solved the problem concerning the copy of the output files to the Ogre bin debug/release directory. The problem come launching copy command directly from Code::Blocks. I've generated a simply batch files that do it automatically ( You can find it in script\codeblocks directory ).

I've defined a project custom variable called OGREODE_HOME. I've set it to OGRE_HOME path. It rappresent the OgreOde root path and it is required only for post build process ( copy output files ). All projects should compile and build also when OGRE_HOME and OgreOde root directory are not the same. $(OGREODE_HOME) project custom variable is present in all projects that needs a copy of output files. For the same proposal I've defined in each project a variable called $(APPNAME). It indicates the application name with file extension.

The next is only for OgreSDK installation.
The three demos try to add a file location that does not exists in OgreSDK directory structure. Next follow correct path for OgreSDK.

rsm->addResourceLocation("../../demos/Media","FileSystem", "OgreOde");

should be possible to add file location for this?

Many thanks for your attention

Alberto Rubinato

------------------------------------------

tuan kuranes

31-08-2006 08:31:38

Thanks agains for sharing !


Have you got another mail address?

My gmail adress doesn't work ?


OGRE_HOME and OgreOde root directory are not the same.

Idea was to always respect OgreOde being in same folder as OgreSDK
\.
.\OgreOde
.\OgreSDK

This way OgreOde folder is always $(OGRE_HOME)/../OgreOde/


The three demos try to add a file location that does not exists in OgreSDK directory structure. Next follow correct path for OgreSDK.
rsm->addResourceLocation("../../demos/Media","FileSystem", "OgreOde");
should be possible to add file location for this?


What SDK you downloaded to get that path for samples media ?

Alberto Rubinato

31-08-2006 12:54:22

Hi,
now I've understood my problem for media location.

$(OGRE_HOME) and OgreOde root paths are at the same level, but not in the same location. For example:

C:\OgreSDK
C:\OgreOde

In my installation the two paths were the same.

For the email address I've got a return message indicating that the file was too large for the system.

Could I send you again it or you had success in downloading from sharing location?

Excuse me for my mistake.

Alberto Rubinato

Alberto Rubinato

31-08-2006 13:53:40

Okay, I've made tests again. Now all is correct.
I've changed $(OGREODE_HOME) default path to C:\OgreOde.

I'll send you corrected projects. Infact I've found some include path errors.

Alberto Rubinato

Alberto Rubinato

31-08-2006 14:03:48

Again problem with mail. Maybe is my provider.

I've shared it at http://www.datafilehost.com/download.php?file=f986c493

Alberto Rubinato

tuan kuranes

31-08-2006 15:48:53

thanks. Added to CVS and Zip File.