Tutorial won't work

forrestcupp

01-11-2006 15:52:16

I installed the MOGRE 0.1.7 + OGRE 1.2.3 SDK installer. I also built the example demos with no problem whatsoever. All of the demos work beautifully. I am using Visual C# Express 2005. I tried to do the Mogre tutorial, and even the very first part of the code won't work. I get two different exceptions depending on whether I use the debug dll's or the release dll's. If I use the release Mogre.dll, I get the following:

The specified module could not be found. (Exception from HRESULT: 0x8007007E)

If I use the debug Mogre.dll, I get the following:

Could not load file or assembly 'Mogre, Version=0.1.7.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. (Exception from HRESULT: 0x800736B1)

Also, when I manually type in the CreateScene method, it automatically puts an exception in the code that says:

"The method or operation is not implemented."

I have tried removing the SDK and reinstalling it after downloading it from another location, and that didn't help.

I know there is another post about the exception I get with the release dll, but it was considered solved, and my problem wasn't addressed. My problem is a little different anyway because I was able to build the example demo with no trouble.

I have installed and set everything up exactly how the instructions say. I really would like to use Mogre if possible. I have checked out Irrlicht, and it doesn't have as much to offer, but at least it works. If anyone could help me get this going, I would greatly appreciate it.

Adis

01-11-2006 17:13:21

It seems that you are running the app from the release and debug folder of your project, but you actually have to copy the exe to the "OgreSDK\bin\release" (or debug) folder.
If you want to run the program from the IDE you have to type this into the post-build event box :
copy "$(TargetPath)" "C:\OgreSdk\bin\$(ConfigurationName)"
this will do the copying for you, and you have to set the working directory to the debug/release directory of your Ogre installation (for the debug configuration debug and for the release the release directory).

forrestcupp

01-11-2006 17:57:51

Thank you for your reply. I had already set up my project to copy to the OgreSDK folder. I set my working directories to the Ogre directories. None of this worked. I don't think it is building properly. I tried to run the exe file that was copied into the OgreSDK directory, and it just gave me the "... has encountered a problem and needs to shut down"

I also have changed the resources.cfg file so that all of the paths are the exact OgreSDK paths that are on my harddrive. I'm doing everything according to instructions and it is not working.

Clay

01-11-2006 18:49:58

Are there any errors in your ogre.log file? (Should be in the same directory as your executable.) If, paste the errors here.

Try this:

1. Undo any modifications to files in the ogresdk/bin/release directory.

2. In your project, remove the reference to Mogre, then add the reference back, making sure that you click the "Browse" tab, and select the Mogre.dll which resides in the ogresdk/bin/release directory.

3. REBUILD your project and move the resulting executable (Projectname.exe, NOT the .vshost.exe) to the ogresdk/bin/release directory.

4. Run the executable. If this still gives you an error, check the ogre.log file. Reply to this message with (a) the error message the program gives you, (b) any errors in ogre.log.

---

The main problem is the DLLs have to be locatable by the CLR. In one of the things you tried above, that seems to be the problem...

If all of this works, then what you need to do is copy all of the dlls from the ogresdk/bin/release directory into both the debug and release directory of your application. OR you can add the release directory to your PATH variable through the control panel.

Let me know how this turns out.

forrestcupp

01-11-2006 19:46:10

Thank you. Moving my exe file to the release folder caused it to work correctly. This brings up another question now. When I create a game, and am ready to distribute it, what in the world do I have to do to get it to work in another directory? If I create a game and give it to someone else who doesn't have Mogre SDK, what do I have to do to get it to work? I tried placing the exe in its own directory with the correct Mogre.dll and Mogre.Demo.ExampleApplication.dll and it didn't work. So I copied all of the other dll's and it had a cfg load error. So I copied all of the cfg files and it complained about not finding some ogre zip file. What all has to be included? Just the dll's amount to 16 megs without even having a game code or media files or anything. It just seems like a lot to me.

I know I'm probably doing something wrong, but I don't really want to invest a lot of time learning this until I know it will work for me in the end. I've already spent a lot of time on Managed Direct X, and if I end up having to go back to it, I don't want to confuse what I've already learned.

But moving the exe did work. Thank you for that. I just don't want to always have to have my files in the OgreSDK\bin\release folder.

Clay

01-11-2006 22:45:23

Ogre has a very specific setup which you really have to understand before jumping into the middle of. Moving all of the dlls/cfg files to your application's directory WILL work, but you have to update all the .CFG files to match the new directory.

Specifically the resources.cfg file needs to be updated to point to the media folder's correct locations.

If you have a working program (which runs in the ogresdk/bin/release directory), and you cannot get it to run when you move files to your project's directory, check Ogre.Log (which will be in the same directory as your application). It should tell you the problems it encountered and why it shutdown.

---

As far as file sizes are concerned, it's true that Mogre + Ogre takes up a large amount of space. You can trim it down by removing some of the plugins you don't use (for example, you can get rid of the openGL plugin if you don't use it, as well as some of the other plugins), but you won't get it to be extremely small. Mogre.dll itself is 6megs. There's no way around this. Also don't forget meshes, textures, and so on, which a moderate sized program uses will quickly dwarf the 12-15 megs of dlls you have to include.

You are buying something with this though. Ogre works at a higher level of abstraction than Managed DirectX does. After you learn it, it's an easier environment to deal with than raw DirectX. More productive. Whether or not this is a tradeoff you are willing to make is all up to you.

Bekas

01-11-2006 22:56:27

When I create a game, and am ready to distribute it, what in the world do I have to do to get it to work in another directory?
A quick summary of what you need:
  1. Mogre.dll[/*:m]
  2. OgreMain.dll[/*:m]
  3. The plugins that you use and are included in "Plugins.cfg" (RenderSystem_Direct3D9.dll, Plugin_OctreeSceneManager.dll, etc.)[/*:m]
  4. Your media files, whose directories are included in "resources.cfg"[/*:m][/list:u]
    (Note, that the *.cfg files are used by Ogre for convenience, you don't *have* to use them, for example you can load plugins and media resources by code.)

forrestcupp

02-11-2006 01:43:37

Thank you everyone for your help. I just want to study things out before I devote myself to something. You have helped me a lot.

Clay

03-11-2006 01:16:25

Try working through Tutorial 0 and Tutorial 1 now. They *should* be fully working with Mogre. Post any problems you have back here.

Thanks. =)

nardev

10-02-2007 11:17:26

Module missing, IMO, means a dll is missing. As with computers in general use the "check for power first" approach. Do not get scared of the error message. Start from the beginning. As for my case:

in the system environment variables "path" i did not put a ";" at the end after adding the ogre debug and release folders as instructed,

OR

i did not restart the visual studio 2005 after changing this variable. Either case now it works when i hit debug in the VS2005. Good luck peeps!