Compiling Mogre with OGRE_THREAD_SUPPORT

GantZ

08-08-2008 10:45:44

First of all , Hello to the mogre community !

I have compiled Mogre with threading support enabled, setting OGRE_THREAD_SUPPORT to 1. it seem the boost library have a conflict with c++/CLI according to this thread

http://objectmix.com/dotnet/121318-not-valid-win32-application-exception-hresult-0x800700c1-2.html

because i have the same error "is not a valid Win32 application. (Exception from HRESULT: 0x800700C1) " when i try to run a application using my newly compiled Mogre, i haven't any problem has long has i disable threading support. i have tried with the solution found on this thread using


#pragma managed(push, off)
#include "somenativeclass.h"
#pragma managed(pop)


around the boost include. i've tried with a simple console application just for testing purpose and it seem to address the issue, but i can't manage to use this solution on the ogre source, it still give me the same error.

have anyone already tried to use thread support with Mogre and ran into this issue ?

I use vc++ 2008, windows XP , boost 1.33.1 and Mogre source from the svn

Bekas

08-08-2008 21:50:54

That's unfortunate. I had run into the same issue with VC++ 2005 and I was secretly hoping that boost would work with 2008, but by your account that does not seem to be the case :?

Bostich

15-01-2010 21:01:15

Hi Guys,

i know this thread is pretty old and i also don't know if there is allready a solution for this out (didnt found one here inside the forum).

But for thoose who are interested in to use Mogre with boost, just do following:

-> add the Boost dependencies to the Mogre Solution (Lib + includes)
-> Open "OgreThreadDefines.h" (OgreMain\Threading\)
->add

#define BOOST_THREAD_USE_DLL

after

#ifndef __OgreThreadDefines_H__
#define __OgreThreadDefines_H__

-> Build Ogre with boost enabled
-> Build Mogre

Once Mogre is compiled, add the Boost precompiled dlls to your runtime directory (otherwise you will get a "FileNotFoundException")


Hope this helps someone ;)


//Bostich

GantZ

17-01-2010 21:50:10

hi bostich !

i just have a couple of question regarding thread support with mogre :

1 - do you have any memory leak when thread are enabled ? i remember a report about memory leak in mogre when thread are used, but i never get the time to check this.

2 - with which version of Mogre do you have tried this ? the last one ?

3 - I'm curious about the fact that you have to use boost as dll rather than as static lib. do you have any more details about this issue ? (you mentioned a filenotofound exception)

thanks !

Bostich

17-01-2010 22:11:22

Hi Gantz,

since iam using my own Ogre wrapper, i cant tell you about 1. and 2.

Static linking was not working for me when i have tried.

//Bostich