Orge Exception: Could not load RenderSystem_Direct3D9

er0s14

12-03-2009 19:52:05



I'm a new user to MORGE. I've followed all of the steps on http://www.ogre3d.org/wiki/index.php/Mo ... Tutorial_0
I'm not sure how to use TortoiseSVN to extract the link, so I used the older MorgeFrameWork instead.
Is there a fix for this error? Any suggestion or guide will help, thanks in advance.

se5a

27-03-2009 06:34:20

What it's looking at is the plugins.cfg
The tute states:
You must do this for all relative directories, "including PluginFolder=." in Plugins.cfg.
which is confuxing, and simply wrong.

if you look closely at the plugins.cfg you will see:

# Defines plugins to load

# Define plugin folder
PluginFolder=.

# Define plugins
Plugin=RenderSystem_Direct3D9
Plugin=RenderSystem_GL
Plugin=Plugin_ParticleFX
Plugin=Plugin_BSPSceneManager
Plugin=Plugin_OctreeSceneManager
Plugin=Plugin_CgProgramManager


If you've followed the tutorial as it reads, you'll have edited the fourth line to this:
PluginFolder=C:/MogreSDK/

and so, when it runs, it will look for the file "RenderSystem_Direct3d9" in the "C:/MogreSDK/" directory, and hey, that file does not live there! ergo, you get the error you describe. take a look in C:\MogreSDK\bin\Release you will see the file in there (it's a dynamic link library, so it is a .dll )

you've probably figured out what to do now, but I'll explain it in detail soon, there is however another catch which the tutorial does not mention!
the Release folder is different to your Debug folder! (noooo durrh those who've been doing this since forever say) so you need a different pluggins.cfg for each folder. note that the .dll files in the debug folder tend to end with " _d.dll "

Now there's two ways to go about fixing this.
1)
For the pluggin.cfg in your Tute0\bin\Release:
have the line point to your C:\MogreSDK\bin\Release
For the pluggin.cfg in your Tute0\bin\Debug:
have the line point to your C:\MogreSDK\bin\Debug

making sure your Release pluggins.cfg is looking for:
Plugin=RenderSystem_Direct3D9
and your debug pluggins.cfg is looking for:
Plugin=RenderSystem_Direct3D9_d
etc. (on all the plugin files).

OR
2)
Copy the contents of:
C:\MogreSDK\bin\Release
into
tute0\bin\Release
and
C:\MogreSDK\bin\Debug
into
Tute0\bin\Debug

so that the .dll are right in the folder, don't edit the
# Define plugin folder
PluginFolder=.

line, since the dot is telling it to look.... in the folder that it's already at.

Hope this clears stuff up and doesn't make things more confusing.

se5a

27-03-2009 07:09:01

OOOOHHhhkay.

It seems there's a problem with the debug .dlls somewhere, which is why the tute does not mention using them. maybe the tute should be a bit clearer on this?

se5a

30-03-2009 03:28:59

So...
In an attempt to figure out exacly what worked and what didn't, and maybe update the tutorial, I started a new project and tried to follow the tutorial, with as little change as possible to get it working - linking to the plugins.cfg .dll to the ones in the \MogreSDK\bin\Release Directory, instead of copying them over to the myproject\bin\Release Directory and linking to that.

except now, Ogre freezes up at "initializing resources" and the last entries in the ogre.log are:

14:55:22: Parsing script OgreLoadingPanel.overlay
14:55:22: Finished parsing scripts for resource group Bootstrap
14:55:22: Parsing scripts for resource group General
14:55:22: Parsing script Examples.program

the exe will run in the \MogreSDK\bin\Release Directory just fine, it will also run fine in the directory I'd set up previously for doing the tutorials before, where I'd copied the plugins over. the odd thing is, I can't see how this would make any difference, since it seems to be freezing up when it's loading stuff from the resources.cfg
here's the kicker - in both projects I'm linking to the ones in the \MogreSDK\ directory as I didn't copy THESE across on the previous project!

weird... am I forgetting to do something else?
It's obviously something to do with the resources, but I can't figure out what.

mrmo

02-04-2009 17:59:21

hey, im having the same exact problem. It freezes at loading resources.cfg even though ALL paths are set correctly..

after testing more,the problem is with this line in resources.cfg:

FileSystem=C:/MogreSDK/Media/materials/scripts

edit:

removing examples.program fixed the issue

Beauty

12-01-2010 17:21:38

Welcome to the 3 newcomers :D

Sorry, the tutorials in the wiki are a little bit outdated.
Thanks for the detailed report.

Here you can download the file MogreFramework.dll for the current Mogre version:
viewtopic.php?f=8&t=11918

Beauty

12-01-2010 17:35:19

Also I have a note for you. It's an alternative to the absolute paths (pointing to the MogreSDK directory). Sometimes this is useful.

Related to the file plugins.cfg:
You can copy all binary files and the plugins.cfg from the MogreSDK to the output directory of your project.
Then you don't need to change the paths in plugins.cfg.

For example when your project output is
C:\Mogre\tutorial0\bin\Release
then copy the files there.

Related to the resources.cfg
You also can use relative paths. So you can copy the needed resource files to your project.
The paths must be relative to the exe file of your project.

Beauty

12-01-2010 17:41:42

Orge Exception: Could not load dynamic library C:\MogreSDK\RenderSystem_Direct3D9
... not found.


It seems so that you used the wrong path in your file plugins.cfg.
I think you have this line:
C:\MogreSDK\Plugin=RenderSystem_Direct3D9
Instead use this:
C:\MogreSDK\bin\Release\Plugin=RenderSystem_Direct3D9

... Or use a local copy of the binary files as I posted in my last post.