Page 1 of 1

Microsoft Visual C++ Express FREAKING OUT!

Posted: Mon Aug 14, 2006 7:38 am
by Cup Of Tea
So, I was happily coding along one day, minding my own business, when WHAM, my changing vector3df(0,1,0) to vector3df(0,-100,0) for the gravity vector of my camera animator suddenly caused this error:

Unhandled exception at 0x0040110f in future fps.exe: 0xC0000005: Access violation reading location 0x00000000.

I was really iritated by this and was running my previously working .exe file wondering why the project would compile but not run. Then I realized it.... when I was running what I thought was the previous version of my .exe file, I was actually running the .exe I had just created and the very same one that failed to run while debuggin in Microsoft Visual C ++. The program would run just fine with no errors when I run it external to the Visual C++ enviroment...

I would really like to fix this problem so I dont have to run the program externally every time I recompile it, but if there is no answer, I will survive. I will post a copy of my entire project as soon as I upload it.

--peace
Cup Of Tea

P.S.I had this happen once before, which resulted in my dropping the project and moving on. Both projects use a .bsp mesh for the level, so my hypothosis is that it has something to do with loading .bsp meshes, especially since in the command line window when running from debug in Microsoft Visual C++ it said after the error came up, could not load mesh... testlevel.bsp

Posted: Mon Aug 14, 2006 8:14 am
by Yotunii
Have you set the path? Cause if you don't set the debug path, it won't run from the directory the .exe is located in, and thus it won't be able to find the map.

Posted: Mon Aug 14, 2006 9:03 am
by IPv6
Express has know issues when debuggin win32 applications. There is no workaround or patch for this at this time (AFAIK). Search win32 forums for details.
:(

Posted: Mon Aug 14, 2006 5:04 pm
by Cup Of Tea
Yotunii: I believe my path is set since it runs the .exe partially but stops at loading the level mesh. But if I dont have it set, how would I do that?

IPv6: I assume by win32 forums you mean microsoft forums right?

Posted: Mon Aug 14, 2006 7:16 pm
by hybrid
If you're compiling the examples into release and debug directories the relative paths to the media folder are not correct anymore: ../../some.mesh is not correct if you're one level deeper. So compile into bin/win32-visual and run from there. Or into the source directory.

Posted: Mon Aug 14, 2006 11:00 pm
by Cup Of Tea
Im modifying the directory for the resources so that they are loading from the correct places, but it comes up with an error when loading the level mesh. I can run the program from outside Visual C++ so my filepaths for the models and textures are fine. I just today wrote the specialFX tutorial (thats what Im doing to teach myself Irrlicht... writing the examples out in my own project instead of copy and pasting it) and it came up with a similar error:

Unhandled exception at 0x00402c77 in SpecialFX.exe: 0xC0000005: Access violation reading location 0x00000000.

this time it stopped right before loading the room.3ds file. So its not the .bsp file neccesarily... again it runs fine outside Visual C++. Here is the actually console error, word for word:

Could not load mesh, because file could not be opened.: ./media/room.3ds

Posted: Tue Aug 15, 2006 1:13 pm
by IPv6
Cup Of Tea wrote:IPv6: I assume by win32 forums you mean microsoft forums right?
i can point you to programming-related forums in Russian, where i read about this issues from very experiensed programmers. Don`t think that it will help you though :/

Posted: Wed Aug 16, 2006 2:20 am
by rooly
do you have an if statement to check whether or not your pointer to the new scene node is valid? this has happened to me, when a mesh fails to load, and no safeguard is put on following uses of it, like texture application or position setting.

the easiest way to protect against this is always making sure to

Code: Select all

if(node)
{
     ...do stuff...
}

Posted: Wed Aug 16, 2006 4:26 am
by Mikenoworth
Yeah, your bsp node is returning a NULL pointer because it couldn't load, but you're still attempting to use it. You don't need to look at your code so much, besides a null pointer check, but as to where your bsp is. You're not giving Irrlicht the right path & filename to load the bsp from, plain and simple.

rooly showed you a simple way of checking the nodes validity, use it. And triple check your bsps path.

If you have doubts then please post your code and the full paths to your .exe and your .bsp.