<Solved>Mogre and tut start up code?


29-01-2008 14:25:41

hi, as a few i see on this forum i am new to ogre and only recently started teaching myself programing with c#.

after a few teething problems with installing and getting Mogre to function, I've managed to follow the tutorials to tutorial number 5 where you write your own start up code instead of using the provided MogreFramework.dll.

The problem i now have is with the void DefineResources() method.
the code compiles without a problem, when you go to run it it errors out with a generic windows error. when you debug via VS it highlights

ResourceGroupManager.Singleton.AddResourceLocation(archName, typeName, secName);

that line of code and states theres a NullReference Exception.

I've double and tripple checked the code i have and its 100% the same as the provided code on the tutorial, the other tutorials function, i've copied the required files across and amended the resources.cfg file with the absolute paths to the resources.

Its probly a simple error on my part since i am new to programing in general, but the tut says you can compile and run its code so i am at a loss as to where i have gone wrong.

*EDIT* I thought i should add that the exe file dosnt get as far as generating a log file, so i cant get any info from there

any help would be much appreciated.

VS2005 SP1
MOGRE 0.2.2 for Ogre 1.4.3 (i know it isnt the latest but the latest wont function for me, spits out links to paths on c:\pryocon.... or something that has never existed.)

Apparently its only a problem in the debug dll files, if i use the release files it compiles and runs perfectly. the other tuts worked with the debug and release dll's.


30-01-2008 20:02:06

Apparently the current Mogre version 1.4.6 still has some problems. See the other thread: http://www.ogre3d.org/phpBB2addons/viewtopic.php?t=6104
I also had several problems getting both the debug and release version running. Unfortunately I can't really tell where the problem exactly is.

Note: The error messages containing "c:\proyectos\mogre\ogrenew" are Marioko's fault while creating the SDK. He hardcoded the links. But anyway, this doesn't really matter, it won't affect the rest of Mogre, it's just a wrong path information. Hopefully, this should be fixed in the next release.


30-01-2008 22:38:54

[edit]Just to supply some more information: This post (http://www.ogre3d.org/phpBB2/viewtopic.php?p=210171) describes the problem concerning the debug version. It's not a Mogre problem, it also happens within the original Ogre project.[/edit]

I just tested the Mogre Installation on my virtual Windows XP machine. I had the same results like Kebal in the end.
The weird thing is, in my main project I've got the debug and release mode now running without problems on Windows Vista. The only other difference is that I'm using the full Visual Studio 2005 Professional SP1 for my project and the Visual C# 2005 Express Edition SP1 on the test system. Therefore I guess it's the same problem with the debug mode as described in http://www.ogre3d.org/wiki/index.php/MOGRE_Installation and http://www.ogre3d.org/phpBB2addons/viewtopic.php?t=4117

Did anyone try installing both, Visual C# Express Edition SP1 _AND_ Visual C++ Express Edition SP1? Or would VC8.0 SDK maybe be enough to solve the debug mode issue?

This is how it went so far:
* OS: Windows XP SP2
* Installed .NET Framework 2.0 Redistributable
* Installed DirectX November 2007 Redistributable
* Installed Visual C++ 2005 Redistributable
* Installed Visual C# 2005 Express Edition
* Installed Visual C# 2005 Express Edition SP1
* Installed MOgre SDK 1.4.6
* Extracted MogreFramework.dlls

* Created a Test-Project in Visual C# 2005 Express Edition SP1
* Set output debug and release directories to "C:\OgreSDK\bin\debug" respective "..\release"

Debug Mode: Doesn't work (FileLoadException with Mogre.dll or one of its dependencies)
Release Mode: Works (remember to set the references to the release versions of Mogre.dll and MogreFramework.dll!)

Note: There is no need to change the PATH-variable in the Environment Settings and add the C:\OgreSDK\bin\debug and release folders. Having the correct dlls in the executing folder is enough to start Ogre.

Very important note: E.g. if your project's output path is set to the bin\debug folder of the original OgreSDK, be very careful not to set the reference to the release versions of Mogre.dll etc. and then compiling!
The standard setting for a reference in Visual C# Express Editon or Visual Studio is set to "local copy" which will result in overriding your debug versions of the dlls without asking!
I just had to reinstall MOgre SDK to get back the original debug Mogre.dll...
Conclusion: I think this issue often resulted in a lot of problems for many users while installing.