Error - The specified module could not be found

Master

22-10-2006 14:31:58

Hi guys

I'm new to C#, familiar with VB.NET and new to OGRE. I'm having difficulty getting the existing demos working on VS Express 2005.

Just to highlight a minor point in case it matters, I had to change Mogre Samples.sln, replacing the line
# Visual Studio 2005 with # Visual C# Express 2005,
for the projects to open.

The projects build without problem.

When running the executable of MogreForm, I am kindly offered to report an error to Microsoft, and nothing much more happens.

When running the other two demos, again, I am offered to report an error, and then get the following error message:

Unhandled Exception: System.IO.FileNotFoundException: The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at Demo.Fresnel.Program.Main(String[] args)

Can anyone point me in the right direction, have I done something wrong?

Thanks in advance
Lee

Master

22-10-2006 20:55:51

To keep things simple, the following VB.NET console app fails with the same error.
Imports Mogre
Module Module1
Sub Main()
Console.Write("I am working")
Dim myVector As Vector3
End Sub
End Module

Reference made to release Mogre.dll
Note: Could not find an equivilent post build event box to place this in: copy "$(TargetPath)" "%OGRE_HOME%\bin\$(ConfigurationName)".

Clay

22-10-2006 23:27:11

I'm having the same problem with OgreNewt. I have all of Mogre working no problem, but when I added OgreNewt then tried to use it, bad things happened....

Clay

22-10-2006 23:31:57

@master
Actually this is probably a case of missing DLLs. Can you make sure ALL of the ogre and mogre dlls are in the correct directory?

@bekas
The installer is missing Newton.dll, could you update it when you get a chance to include that dll? Thanks.

Adis

23-10-2006 14:00:20

I think that the distribution of the newton dll is forbidden by its licence, you'll just have to download the entire sdk to get it
http://www.newtondynamics.com/downloads.html

From the licence:
4) The LICENSEE may not redistribute the SOFTWARE, except as part of a compiled software program that is not itself a physics library.

Clay

23-10-2006 14:30:56

Yikes. Well, at least it's a C library. I was actually worried that it would be incompatible due to C++ linking issues. I copied the one in another project to my current project and it worked well.

Bekas

23-10-2006 15:59:46

@Master: All the necessary Ogre dlls need to be in the same directory as Mogre.dll. Read this page to see how you can execute the samples. And study the beginner tutorials of Ogre to get a grasp of how the directories of an Ogre project should be setup, what "plugins.cfg" and "resources.cfg" do, etc. The vast majority of the Ogre documentation is applicable to Mogre too.

@Clay: I didn't include Newton.dll to avoid the fuss of making sure that I conform with Newton's license.

Clay

23-10-2006 16:08:59

Good idea, but you may want to include a small readme which states "You will need to obtain newton.dll from ..." to avoid confusion.

Bekas

23-10-2006 16:18:23

I've put a readme like this inside the "MogreNewt samples" directory. Maybe I should put somewhere more obvious. (..and put it on SVN too, it's only on SDK at the moment)

Clay

23-10-2006 16:21:49

Ahh ok, I must have missed it.

Master

26-10-2006 23:15:16

Thanks Bekas

My directory contains the following files:

C:\OGRESDK\BIN\RELEASE
CEGUIBase.dll
CEGUIFalagardBase.dll
CEGUITaharezLook.dll
CEGUIWindowsLook.dll
cg.dll
DevIL.dll
ILU.dll
ILUT.dll
media.cfg
Mogre.Demo.ExampleApplication.dll
Mogre.Demo.Fresnel.exe
Mogre.Demo.MogreForm.exe
Mogre.Demo.SkeletalAnimation.exe
Mogre.dll
MogreNewt.dll
OgreGUIRenderer.dll
OgreMain.dll
OgrePlatform.dll
Plugins.cfg
Plugin_BSPSceneManager.dll
Plugin_CgProgramManager.dll
Plugin_OctreeSceneManager.dll
Plugin_ParticleFX.dll
RenderSystem_Direct3D9.dll
RenderSystem_GL.dll
resources.cfg
zlib1.dll

Do I need to place additional references in the project? - I have only referenced MOGRE.dll
I have done no further project setup other than adding the post-build command, am I missing something?

Thanks
Lee

Bekas

27-10-2006 09:30:51

Did you build Demo.ExampleApplication ? It's a dll that SkeletalAnimation and Fresnel depend on. And are you running MogreForm from the "C:\OgreSDK\bin\release" directory?

I tested building the samples of the SDK with C# express and they're working fine.

Master

28-10-2006 12:46:33

And are you running MogreForm from the "C:\OgreSDK\bin\release" directory?
No, and in doing so it works. Thanks a bunch!

I assumed that as you reference MOGRE (at an external location than your build), MOGRE loads OGREMAIN.dll from where it is locally, and references it's dlls/configs from where it is also? (well obviously not). Where can I read up on these sorts of basics? - I know the language, however not much around it.

Now I can learn OGRE, without having to become familior with C++, once OGRE's mainly cracked, I can start switching to C++ (but from how swish this looks, I might not even have to!)

Thanks again
Lee

Clay

30-10-2006 01:51:41

When you run a program which uses Mogre.dll, it does load Ogre.dll (and all the other ogre dlls) as well. You have to be careful because windows is very picky about where the ogre dlls reside. It may need to be in the working directory of the program, or in windows/system32, or in another path location which it can find... That's really the only thing you need to know (and experiment with) until you get your program up and running.

Bekas

30-10-2006 07:03:21

I assumed that as you reference MOGRE (at an external location than your build), MOGRE loads OGREMAIN.dll from where it is locally, and references it's dlls/configs from where it is also?
No, if you add an external reference Visual Studio copies the dll to your project's bin folders. So you either have to copy all necessary files to your project's folder or copy your executable and have Visual Studio execute it from another location (so that you can debug it).

And in general, it's a good idea to add 'c:\OgreSDK\bin\debug' and 'c:\OgreSDK\bin\release' to the PATH environment variable, because otherwise if you use Mogre classes in a control that requires the designer (windows user control etc.), the designer may throw errors cause it won't find OgreMain/OgreMain_d.dll.

Master

31-10-2006 21:59:15

Thanks for your help Clay & Bekas

I look forward to using MOGRE - Please consider this post solved.

Lee

Clay

01-11-2006 18:55:49

And in general, it's a good idea to add 'c:\OgreSDK\bin\debug' and 'c:\OgreSDK\bin\release' to the PATH environment variable, because otherwise if you use Mogre classes in a control that requires the designer (windows user control etc.), the designer may throw errors cause it won't find OgreMain/OgreMain_d.dll.

Actually I think you should probably only put either the Release or the Debug dlls into your path statement and not both, as it might resolve the wrong one... For example, if you added the Release version of Mogre to your project, and the Debug directory comes before the Release in your PATH statement, then when Mogre.dll tries to load Ogre.dll, it will first look for (and find!) the debug version of the dll.

I hate DLL hell, which is a lot of what the problems in this forum are caused by.

Bekas

01-11-2006 19:02:11

It's not a problem because release Mogre.dll will load OgreMain.dll and the debug Mogre.dll will load OgreMain_d.dll, so they won't get mixed up.

Clay

01-11-2006 22:13:46

Ah good point. =)

TundraBlue

25-07-2010 06:03:08

Did you build Demo.ExampleApplication ? It's a dll that SkeletalAnimation and Fresnel depend on. And are you running MogreForm from the "C:\OgreSDK\bin\release" directory?

I tested building the samples of the SDK with C# express and they're working fine.


Changing to release mode solved the problem for me as well. Why am I not able to run in debug mode on these demos?

mstoyke

25-07-2010 12:36:50

Are you using the Express version of Visual C#? If so, try to also install the Express version of Visual C++, because it will install the debug versions of the C++ runtime libraries on your machine. The debug version of the runtime libraries are necessary to run the debug version of Ogre and installing Visual Studio or Visual C++ Express are the only valid ways that I'm aware of to make them available for the DLLs.

Btw, your post is an epic bump for this thread.