Runtime error at Creating the root object in Basic Tutorial0

Rhynedahll

20-01-2008 17:36:43

I'm new to C# and Mogre and am trying to follow the tutorials. When I run the first code segment for Tutorial 0, the Mogre load screen runs and then I get a runtime error when the progress bar is at "Creating the root object..."

Anyone have any guidance?

I'm using Visual C# 2008 Express and Have the latest version of the Mogre SDK (last week. )

I'm not very familiar with the Visual C# interface but believe that I have followed the directions in the Tutuorial correctly.

raygeee

26-01-2008 16:13:23

Without knowing the kind of runtime error you get it's hard to tell where the problem is.
What does it say? And what's written in your ogre.log?

Dizzle

27-01-2008 08:17:30

I'm in the same boat, new to C# and Ogre / Mogre.

I am running through Tutorial 0
I have followed all steps and checked all Troubleshooting options.
Mogre SDK 1.4.6 VC80 Installed

When I go to debug Program.cs I see the Mogre Splash/Load Screen and then I get a Runtime Error stating:


"Runtime Error!

Program: ...plate\Mogre Template\bin\Debug\Mogre Template.vshost.exe

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information."

Rhynedahll

27-01-2008 15:07:55

Thanks for the replys.

As I said, I'm new to ogre, so I didn't know about the ogre.l

From the ..\bin\debug ogre.log

12:37:46: OGRE EXCEPTION(7:InternalErrorException): Could not load dynamic library .\RenderSystem_Direct3D9. System Error: The specified module could not be found.

in DynLib::load at ..\src\OgreDynLib.cpp (line 80)

From the ..\bin\release ogre.log

10:34:46: OGRE EXCEPTION(6:FileNotFoundException): 'plugins.cfg' file not found! in ConfigFile::load at ..\src\OgreConfigFile.cpp (line 84)
10:34:46: plugins.cfg not found, automatic plugin loading disabled.
10:34:46: *-*-* OGRE Initialising
10:34:46: *-*-* Version 1.4.6 (Eihort)
10:34:46: OGRE EXCEPTION(6:FileNotFoundException): 'resources.cfg' file not found! in ConfigFile::load at ..\src\OgreConfigFile.cpp (line 84)

So, where are the plugins.cfg file and the resources.cfg file supposed to be?

I'll investigate, but will check back here for suggestions.

Thanks again.

Dizzle

27-01-2008 16:25:36

I tried uninstalling 1.4.6 and installing 1.4.3, just in case, but same error.

My Ogre.log was reporting the same RenderSystem_Direct3D9 Error.

The initial Plugins.cfg contains the following line:
# Define plugin folder
PluginFolder=.


My reading of Tutorial 0 made me think I should change it to:
# Define plugin folder
PluginFolder=C:/OgreSDK/


But to fix the problem, the line should actually read:
# Define plugin folder
PluginFolder=C:/OgreSDK/bin/release/


Also, make sure you have copied the modified *.cfg files to both your Project ../bin/debug/ and ../bin/release/ folders.

raygeee

27-01-2008 16:58:12

The following code in the plugins.cfg just tells Ogre to search for the plugins in the current directory (which would be something like bin/debug/ or bin/release/)
# Define plugin folder
PluginFolder=.

Better leave it at that or change it to a subdirectory.

I guess your problem lies in the second part:
# Define plugins
Plugin=RenderSystem_Direct3D9_d
Plugin=RenderSystem_GL_d
Plugin=Plugin_ParticleFX_d
Plugin=Plugin_BSPSceneManager_d
Plugin=Plugin_OctreeSceneManager_d
Plugin=Plugin_CgProgramManager_d

Note that Ogre needs the debug dlls in debug mode and the release dlls in release mode. Therefore the plugins.cfg in the debug folder has to differ from the one in the release folder. In the debug folder you have to add the suffix "_d" to the plugins to help Ogre find the correct dlls.

The files plugins.cfg and resources.cfg are both supposed to exist in the bin/debug/ and in the bin/release/ folder (or any other directory where your compiled program is located)

Also, make sure you have copied the modified *.cfg files to both your Project ../bin/debug/ and ../bin/release/ folders.
This might have led to the problem. Don't use the same plugins.cfg in both folders!

Rhynedahll

28-01-2008 21:49:46


Note that Ogre needs the debug dlls in debug mode and the release dlls in release mode. Therefore the plugins.cfg in the debug folder has to differ from the one in the release folder. In the debug folder you have to add the suffix "_d" to the plugins to help Ogre find the correct dlls.




The files plugins.cfg and resources.cfg are both supposed to exist in the bin/debug/ and in the bin/release/ folder (or any other directory where your compiled program is located)


I made these changes:

Copied plugins.cfg and resouces.cfg to bin/release
Added _d extension to bin/debug folder.

Then I got this error:

15:31:29: Loading library .\RenderSystem_Direct3D9_d
15:31:29: OGRE EXCEPTION(7:InternalErrorException): Could not load dynamic library .\RenderSystem_Direct3D9_d. System Error: This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem.

in DynLib::load at ..\src\OgreDynLib.cpp (line 80)
15:31:34: *-*-* OGRE Shutdown

So, should I reinstall and why does the program install incorrectly?

Krahodille

29-01-2008 18:31:27

I have the same trouble...
Then runing aplication, it requires file d3dx9_36.dll.
Try to install the latest version of DirectX9. This helped me solve the problem.

P.S. sorry for the terrible English

Kebal

29-01-2008 21:39:01

I had very similar error messages when i first started using ogre.

I found that the only files it would ever say where missing were the ones listed in the plugins.cfg file, and there was 2 solutions.

1: change the top section of the plugins.cfg file so it has the full path to these files (default: c:\OgreSDK\Bin\Debug (or Release)), this way all the needed files can be found but all ogre apps will use the same copies of these files and wont be self contained programs in 1 directory.

2: Copy all the .dll files from the OgreSDK\Bin\Debug or Release directory into the projects directory (MyApp\Bin\Debug or Release) this way the plugins path of "." which means this current directory is where the dll files are and avoids the file not found error.

Personaly i copy these files over:
cg.dll (needed when creating root object apparently?)
media.cfg (just copied it because the tut told me to copy all .cfg files)
Mogre.dll (its a reference in all the tuts so its copied automaticly)
ogre.cfg (gets generated when the ogre config screen loads if it isnt copied)
OgreMain.dll (needed by anything ogre or so i am told)
Plugin_BSPSceneManager.dll
Plugin_CgProgramManager.dll
plugin_OctreeSceneManager.dll
Plugin_ParticleFX.dll
Plugins.cfg (loads these plugin dll files)
quake3settings.cfg (i think is isnt needed in most ogre apps but tut said copy it so there it is)
RenderSystem_Direct3D9.dll (this is needed to provide Directx render system, plus the ogre config screen errors with runtime.... request abnormal termination if its missing)
RenderSystem_GL.dll (same as the above directx file only this is for openGL)
resources.cfg (lists the path to the media folder that contains meshes etc, remember to replace the paths that start with /../../name with the absolute paths like c:/OgreSDK/Media that way the media files can be found and loaded (like ninja.mesh)).

Also the plugins.cfg file should be different for the debug and the release versions, in the debug version the files it lists should all have _d at the end of there names and be sure to copy the files from the OgreSDK\Bin\Debug folder that has _d at the end of there names.

when you compile and run you should also get these files appearing
Mogre.pdb
MyApp.pdb

I am still new to programing and not sure if these are actualy needed or just leftovers from a messing linker or something but they appeared when i compiled so i mentioned its normal for them to be there.

also something worth mentioning, people seem to have alot of problems with the debug dll's so you can try just using release files and see if this resolves the issue as a workaround. theres a forum post that tells you to find CRTDebug...... folder and amend a policy file but i dont have the link for it atm. this fixed my debug dll problems.

I'm new to Programing, Mogre and this forum, so i hope my as i see it account of what i have experenced is usefull to anyone with these errors.

Kebal

29-01-2008 21:43:49

Thought i would link that post i mentioned about problems using the debug dlls, it worked for me.

http://www.ogre3d.org/phpBB2addons/viewtopic.php?t=4117


a good way down the page it talks about c:\windows\winsxs\vs.vc8.0 blah blah blah.

its a damb long file path, but anyway follow the steps he says there, and remember its a system file so backup the file befor you save the changes.

just open the .policy file in notepad or wordpad or some other txt editor.

kaushalkmj

07-03-2008 20:48:01

I suggest anyone who gets runtime errors, and has atleast a bit of experience witht eh compler u r using : Get a dump of the SRC files of OGRE, even though u use the pre-built SDK. Sometimes in errors such as this, looking into and around the region of the error gives away the solution.

Like in this case, its pretty clear that the DirectX was not found / or was of an older version than supported ..

For me, the line 80 problem was solved by installing the latest DX9 sdk.

http://www.microsoft.com/downloads/deta ... laylang=en

- look before u leap :)
regs.

I have the same trouble...
Then runing aplication, it requires file d3dx9_36.dll.
Try to install the latest version of DirectX9. This helped me solve the problem.

P.S. sorry for the terrible English