DataStream, VC2005 - Multi-Threaded (/MT) (/MD)


08-08-2006 13:57:43

I've enountered some problems parsing a datastream from a dotsceneoctree file. The same code worked with mingw and earlier versions of pyogre. With VisualC++ 2005 "getAsString" occasionaly works but mostly crashes. "" always works.

The code is as follows:

pStream = ogre.ResourceGroupManager.getSingleton().openResource("Example.material",'General')
#data = pStream.getAsString()
data =
print data

# MyScene.scene is just an xml file
#pStream = ogre.ResourceGroupManager.getSingleton().openResource("MyScene.scene", "General")
#data = pStream.getAsString()
#data =
#print data

Reading this thread I updated the c++ Code Generation Multi-Threaded (/MT) to DLL (/MD): ... etasstring

I'm not really familiar with VC++2005 so I'm not sure of the implications of doing the above but I'm quite suprised that this hasn't been raised before.


08-08-2006 16:47:03

Ok I've looking at this further seems the problem is restricted to OpenGL (I'm using latest NVidia drivers). Here are the steps that cause the crash on my computer:

a) Downloaded and install Istari's pyogre version
b) Run above code
- DirectX runs OK, OpenGL - crash
c) Rerun
- OpenGL/DitrectX - crash
d) clear out C:\Python24\Lib\site-packages\pyogre
clear out *.pyc files
reinstall Istari's pyogre version
e) Run above code
- DirectX runs OK, OpenGL crashes as before
f) renamed RenderSystem_GL.dll to ensure stray DLL not being picked up
g) Compile pyogre with /MT, same crashes
h) Compile pyogre with /MD both DirectX / OpenGL work fine


08-08-2006 23:19:02

After reading this I'm thinking that PyOgre should probably be compiled with /MD
Since all the other libraries that it links against use /MD


09-08-2006 01:59:41

Ok, could be a follow on from pre pyogre 1.0.6 which I think was setup to use Visual C++ Toolkit 2003 and AFAIK, doesn't support /MD. Also there appears to be an approx 5% performance drop using MD as compared to MT.