Access violation on meshShape::generateTriangleMesh

LuRenJia

18-10-2006 17:41:23

Hi betajaen!

I got an error 0xC0000005: Access violation when calling createStaticBody with a meshShape. My code is:

mScene->createStaticBody("ogrehead","ogrehead.mesh",new meshShape("ogrehead.mesh",mScene),Vector3(10,(2.47 / 2),10));


In fact I directly copy code from your tutorial and modified, the nx.stair1.mesh don't work too. Error occured at line:


if (NxCookTriangleMesh(mTriangleMeshDescription, buf)) {


I use VC8 (not express edition) and OGRE sdk 1.2.0 (1.2.3 has a same error), NxOgre 0.5 preview 3.

Calling stack:
msvcr80d.dll!memcpy(unsigned char * dst=0x00000000, unsigned char * src=0x0012f1a8, unsigned long count=1) line 350 Asm
nxOgre_d.dll!MemoryWriteBuffer::storeBuffer(const void * buffer=0x0012f1a8, unsigned int size=1) line 183 + 0x1a byte C++
nxOgre_d.dll!MemoryWriteBuffer::storeByte(unsigned char b='N') line 145 + 0x15 byte C++
NxCooking.dll!0092af32()
[...]
NxCooking.dll!0092c3d3()
NxCooking.dll!0090675f()
nxOgre_d.dll!nxOgre::meshShape::generateTriangleMesh() line 366 + 0x16 byte C++
nxOgre_d.dll!nxOgre::meshShape::meshShape(std::basic_string<char,std::char_traits<char>,std::allocator<char> > _modelName="ogrehead.mesh", nxOgre::scene * _scene=0x0e6c0ec8) line 220 C++
BVR.exe!BVR::createScene() line 96 + 0x97 byte C++
BVR.exe!ExampleApplication::setup() line 95 + 0xf byte C++
BVR.exe!ExampleApplication::go() line 55 + 0xf byte C++
BVR.exe!WinMain(HINSTANCE__ * hInst=0x00400000, HINSTANCE__ * __formal=0x00000000, char * strCmdLine=0x00151ef9, HINSTANCE__ * __formal=0x00000000) line 590 + 0xb byte C++
BVR.exe!__tmainCRTStartup() line 578 + 0x35 byte C
BVR.exe!WinMainCRTStartup() line 403 C
kernel32.dll!7c816d4f()
kernel32.dll!7c8399f3()
msvcr80d.dll!_close_nolock(int fh=3997806) line 99 + 0x6 byte C
msvcp80d.dll!std::operator>><char,std::char_traits<char> >(std::basic_istream<char,std::char_traits<char> > & _Istr={...}, char * _Str=0x6a006a00) line 962 + 0x14 byte C++
7afe9468()

betajaen

18-10-2006 17:45:02

The number one cause of these errors is compiling it as Debug. Are you compiling it as Debug?

LuRenJia

19-10-2006 04:03:19

Thanks betajaen.

Yes, I am compiling it as debug. Can't as debug?

wspnut

19-10-2006 04:44:52

Thanks betajaen.

Yes, I am compiling it as debug. Can't as debug?


PhysX does not come with debug-supporting libraries, so you can only compile programs using NxOgre/PhysX as runtime.

LuRenJia

19-10-2006 06:34:25

Thanks!

I will compile it using release lib of NxOgre.

LuRenJia

19-10-2006 13:32:16

Ok, it works fine, but I can't debug my program, any idea? by log?

ColeZero

19-10-2006 13:36:47

Yeah, you can do it by log or by console-output.
Iam putting all the things i need to check into the console-output and in a log-file, for example, various variables or positions..

BlasterN

20-10-2006 01:41:36

To use Debug you need to disable NxOgre I do it using #define #ifdef

LuRenJia

20-10-2006 09:48:01

Now I got some error, maybe code bug, so I place statement "logMessage" somewhere, but can't catch up the exception yet, it made me madly! :cry: