Microsoft Visual C++ Express FREAKING OUT!

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Cup Of Tea
Posts: 8
Joined: Thu Aug 03, 2006 5:45 am

Microsoft Visual C++ Express FREAKING OUT!

Post 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
Yotunii
Posts: 16
Joined: Sun Aug 13, 2006 9:44 am

Post 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.
IPv6
Posts: 188
Joined: Tue Aug 08, 2006 11:58 am

Post 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.
:(
Cup Of Tea
Posts: 8
Joined: Thu Aug 03, 2006 5:45 am

Post 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?
--peace
Cup Of Tea
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post 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.
Cup Of Tea
Posts: 8
Joined: Thu Aug 03, 2006 5:45 am

Post 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
--peace
Cup Of Tea
IPv6
Posts: 188
Joined: Tue Aug 08, 2006 11:58 am

Post 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 :/
rooly
Posts: 224
Joined: Tue Oct 25, 2005 4:32 pm
Location: Louisiana, USA, backwater country
Contact:

Post 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...
}
When banks compete, you win.
When ISPs compete, you win.
When electronics retailers compete, you win.
When governments compete...you get drafted.
Mikenoworth
Posts: 78
Joined: Sat May 27, 2006 9:24 pm
Location: Logan, UT

Post 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.
Stout Beer
Post Reply