Unregistering ResourceManager

Problems building or running the engine, queries about how to use features etc.
Post Reply
paupav
Gnoblar
Posts: 12
Joined: Sun May 12, 2013 2:07 pm

Unregistering ResourceManager

Post by paupav »

Hello, I've tried building example application and this is what I've got

Code: Select all

Registering ResourceManager for type HighLevelGpuProgram
Registering ResourceManager for type Compositor
MovableObjectFactory for type 'Entity' registered.
MovableObjectFactory for type 'Light' registered.
MovableObjectFactory for type 'BillboardSet' registered.
MovableObjectFactory for type 'ManualObject' registered.
MovableObjectFactory for type 'BillboardChain' registered.
MovableObjectFactory for type 'RibbonTrail' registered.
Loading library /usr/local/lib/OGRE/RenderSystem_GL.so
Installing plugin: GL RenderSystem
OpenGL Rendering Subsystem created.
Plugin successfully installed
Loading library /usr/local/lib/OGRE/Plugin_OctreeSceneManager.so
Installing plugin: Octree Scene Manager
Plugin successfully installed
*-*-* OGRE Initialising
*-*-* Version 1.9.0 (Ghadamon)
An exception has occurred: OGRE EXCEPTION(6:FileNotFoundException): 'resources.cfg' file not found! in ConfigFile::load at /home/paulo/Downloads/sinbad-ogre-55e89ae88219/OgreMain/src/OgreConfigFile.cpp (line 82)
*-*-* OGRE Shutdown
Unregistering ResourceManager for type Compositor
Unregistering ResourceManager for type Skeleton
Unregistering ResourceManager for type Mesh
Unregistering ResourceManager for type HighLevelGpuProgram
Uninstalling plugin: Octree Scene Manager
Plugin successfully uninstalled
Unloading library /usr/local/lib/OGRE/Plugin_OctreeSceneManager.so
Uninstalling plugin: GL RenderSystem
******************************
*** Stopping GLX Subsystem ***
******************************
Plugin successfully uninstalled
Unloading library /usr/local/lib/OGRE/RenderSystem_GL.so
Unregistering ResourceManager for type Material
What should I do? I've spent my whole day trying to make Ogre to work, I've solved few problems and I don't know what should I do with this one? Why is it trying to find resources.cfg in Ogre's build folder instead of the project folder and how can file be inside file?
I'm running Ubuntu 15.10 and I'm using Codeblocks
hydexon
Gremlin
Posts: 164
Joined: Sun Apr 14, 2013 8:51 pm
x 10

Re: Unregistering ResourceManager

Post by hydexon »

Probably the resoruces.cfg is not located in your working directory where the application is being executed
paupav
Gnoblar
Posts: 12
Joined: Sun May 12, 2013 2:07 pm

Re: Unregistering ResourceManager

Post by paupav »

It is in the project folder and one copy of resources.cfg is where IDE creates executable
Attachments
Screenshot from 2016-02-08 18-35-43.png
Tagada
Gnoblar
Posts: 7
Joined: Tue Feb 09, 2016 10:45 am

Re: Unregistering ResourceManager

Post by Tagada »

Hello,

I met the same error (with very strange unavailable file location mention) while trying to install the very first tuto of Ogre,
"OgreWikiTutorialFramework_1-9.zip" from http://www.ogre3d.org/wiki/;

As I'm new on using Visual Studio 2015 under Windows 7 pro SP1 x64, i spent few days to make VS2015 build this - as it seems to be - very simple project.

First i download and install Visual Studio 2015 Community;
then I download Ogre :
"OGRE-SDK-1.9.0-vc140-x86-09.01.2016.7z" from http://www.ogre3d.org/forums/viewtopic.php?t=69274
After install this package, i get errors about missing Boost library...
I download Boost :
"boost-1.60-vc140-x86-09.01.2016.7z" from the same topic on ogre3d.org/forums ;
I have made the necessary (i hope so) adjustments in Project/Options ;

Build solution witout error (success);
and when Debug-Start-without-debug (Ctrl+F5) the WikiTutorialFramework project, I obtain the message :
Error File not found in an unexpected location
Error File not found in an unexpected location
but the path D:\Work doesnt exist ! (D:\ exist on my PC but i have never create D:\Work and it still not exist yet...

I try also to copy resources.cfg as resources_d.cfg into the Debug\ path where my file.exe where created by Visual Studio, but i was unsuccessful.

I someone have a fix or an issue or some idea, it will be welcome
(I still have some hair ...)
Thanks.
User avatar
spacegaier
OGRE Team Member
OGRE Team Member
Posts: 4304
Joined: Mon Feb 04, 2008 2:02 pm
Location: Germany
x 135
Contact:

Re: Unregistering ResourceManager

Post by spacegaier »

@paupav:
Is the executable really in the folder from your screenshot and not in the "bin/" sub folder?

@Tagada:
This path you see in the error message is not one of your local machine, but from the machine the Ogre binaries were built on (in your case as you downloaded them from someone else, it's a path on their machine).

Are you running the application directly from VS? In that case make sure that you set the correct "Working Directory", since otherwise copying the resources_d.cfg file does not have any real effect (unless you start the application manually from the Windows Explorer).
Ogre Admin [Admin, Dev, PR, Finance, Wiki, etc.] | BasicOgreFramework | AdvancedOgreFramework
Don't know what to do in your spare time? Help the Ogre wiki grow! Or squash a bug...
Tagada
Gnoblar
Posts: 7
Joined: Tue Feb 09, 2016 10:45 am

Re: Unregistering ResourceManager

Post by Tagada »

@spacegaier:
Thanks, with your reply i walk a little few step forward :
:idea: - as you said the path shown in the error message reflect the path into the machine the Ogre binaries were built on, i think there is here something to improve in order to show the real actual path where the program is unable to find the expected file ;
:arrow: - then i check my Working Directory so it seems to be well defined (my VS2015 is french version and in order to follow differents tutorials i have downloaded english language package from Microsoft and... surprise ! :shock: the interfaces are very different with some missing options and un-translated options.
for example this is the project properties in the french version :
french project properties page...
french project properties page...
and the english version :
ProjProperties_en.png
... many options have disappeared and are not found elsewhere in the menu... :/ so i go back to french version .

- Next i checked my directories outside of VS, with the Windows file explorer and discover that VS2015 had created 2 Debug and 2 Release directories, but only 2 with my .exe file :
[SolutionDirectory] \ Debug \ [myfile.exe]
[SolutionDirectory] \ Release \ [myfile.exe]
[SolutionDirectory] \ [ProjectDirectory] \ Debug (without exe file)
[SolutionDirectory] \ [ProjectDirectory] \ Release (without exe file)

so i copied the needed .dll and .cfg files beside of .exe (i.e. OgreMain_d.dll, resources_d.cfg, etc. in \Debug,
and OgreMain.dll, resources.cfg, etc. in \Release) and run my exe file from the File Explorer...

:idea: Then i began to understand what where wrong here :
the expected file Debug\resources_d.cfg and Release\resources.cfg contains instructions like
"Zip=../../Media/packs/SdkTrays.zip" to load some specific files that are not actually on the hard disk (yes they are, but not at the location specified in resources.cfg)

OK... have a (bad ?) idea :
- blank the .cfg file (or delete if exist and make an empty one) because :
- i don't know what is the purpose of those files mentioned inside .cfg;
- i have the original resources.cfg in the downloaded package;
- i "just" want to follow the Grrmlmlml wonderfull Ogre Wiki Tutorial Framework (but perhaps the real first (self)tutorial is... to reach the tutorial setup itself ! :lol:

Running the exe file from the windows file explorer, with a blank .cfg beside :
when resources.cfg is empty
when resources.cfg is empty
Ogre_EngineRendrSetup.png (33.43 KiB) Viewed 663 times
that's it !... time to make a pause, I'll come back :)
(so i suggest to copy all the files needed by the original resources.cfg to the corresponding relative directory from your exe file but... where will it be pointing to, in the VS2015 projects directories tree? -> to be continuated )
Tagada
Gnoblar
Posts: 7
Joined: Tue Feb 09, 2016 10:45 am

Re: Unregistering ResourceManager

Post by Tagada »

come back :
At this point of time, trying to execute the project within VS2015 produce the same error :
file not found... in cpp file.
file not found... in cpp file.
FileNotFound_cfgfile.png (5.83 KiB) Viewed 655 times
Ok... here the trouble don't come from the files mentioned inside resources_d.cfg but from the path to find resources_d.cfg...
What is very disturbing is that the message speak about a .cpp file as origin of the error (to an obsolete location), while the zip downloaded package does not contain any .cpp source file...
More, executed from outside VS2015, the exe file don't produce any error !
Is VS2015 so stupid (or me ) ?(please don't answear... :oops: )

I loose my last hairs...go check again for a working directory i surely have omited somewhere in the labyrinths of VS options...
Last edited by Tagada on Wed Feb 10, 2016 2:15 am, edited 1 time in total.
User avatar
c6burns
Beholder
Posts: 1512
Joined: Fri Feb 22, 2013 4:44 am
Location: Deep behind enemy lines
x 138

Re: Unregistering ResourceManager

Post by c6burns »

Chasing after the exception in OgreConfigFile is a waste of time. In your application, you are trying to load a bunch of resources from a config file. In your application, you are instantiating an OgreConfigFile class and calling its load method (http://www.ogre3d.org/docs/api/1.9/clas ... e24a10b4a8)
I bet it looks a lot like this:

Code: Select all

	// Load resource paths from config file
	Ogre::ConfigFile cf;
	cf.load(mResourcesCfg);
Except you are asking it to load a file that doesn't exist. Period. Since it cannot load files that do not exist, it has no choice but to throw an except .... this is to help you realize how you are screwing things up and go fix them. Either by moving the file into the same working directory as the application binary, or by changing the contents of the string you are passing to the load method.
Tagada
Gnoblar
Posts: 7
Joined: Tue Feb 09, 2016 10:45 am

Re: Unregistering ResourceManager

Post by Tagada »

thanks to c6burns for the reply, but...

I don't do anything, i don't want to load any resources.cfg !
I just would like to follow the wiki turorial and folowing the steps required by the tuto, i create a project in VS, copy the source files provided and try to build and execute, but this error occurs.

So i have the curious sensation to be on the way to teach to the teacher how to teach me his lesson...
User avatar
c6burns
Beholder
Posts: 1512
Joined: Fri Feb 22, 2013 4:44 am
Location: Deep behind enemy lines
x 138

Re: Unregistering ResourceManager

Post by c6burns »

Well I can't teach you C++ or how directories in filesystems work ... this is really basic stuff that you should know beforehand. You should be stepping through all your code in the debugger to learn how it actually works. You downloaded a framework or used an app generator or something and now you have a bunch of code you don't understand and isn't working. It's probably not going to start working on its own, without your understanding it. But in the very least you should be able to fix basic filesystem shit like this. It's not hard to put a config file in the same working directory as an exe. And it's also not hard to edit that config file to point to the actual location of your resources. Try it and see for yourself.

Also I am not asking you if you are trying to load a resource config file ... I am telling you that you are! Now that you know you are, you can go find where you are and how you are and learn. If you don't want to load a resources config file then obviously you need to load resources another way, or your ogre program is going to render just a black screen (or crash, because you are using a tutorial framework which relies on some of the basic resources that the config helps the framework to locate)
Tagada
Gnoblar
Posts: 7
Joined: Tue Feb 09, 2016 10:45 am

Re: Unregistering ResourceManager

Post by Tagada »

@c6burns :
thanks for your reply.
You are surely right and with my poor english (which is not my mother tongue), I feel like having hurt you and that was not my intend.
in that case I appologize ; I appreciate the help from community.

I tryed to follow a tutorial founded on this forum, surely working fine for all others, but not in my case.
While i can work in Visual Studio with non-Ogre programs, this first one don't.
Anyway, the trouble is on my side and if it works fine on other places, then I must have done something wrong.

I know i'm the class ass, here. but you don't answeared to the question.
So i will continue to search some solutions on my way.
However I'm not sure we need to understand the inner deep workings of c++ to be able to use a high-level application like Ogre.
And as it seems for the first post on this topic, the problem is not solved.
Certainly, if i found a solution, i will propose a new topic in case it can help Ogre-beginners.
Thanks again.
User avatar
c6burns
Beholder
Posts: 1512
Joined: Fri Feb 22, 2013 4:44 am
Location: Deep behind enemy lines
x 138

Re: Unregistering ResourceManager

Post by c6burns »

No, no it's my fault. I'm just an impatient person.

When you see "resources_d.cfg" file not found ... it means you don't have resources_d.cfg in the correct folder. Copy it into the folder with your .exe. Also copy plugins_d.cfg

Open resources_d.cfg or resources.cfg (_d is for the debug version). All of the entries are pointing to the location for your media. Make sure these paths are correct, or else the application will not function because it will fail to find SdkTrays.zip

plugins.cfg tells Ogre which optional plugins you wish to load. This is very important because RenderSystems are built as plugins. If you don't load any plugins, you won't have any RenderSystems and so your application will not be able to start properly. Each plugin you are loading from plugins.cfg should also be in the same folder as your .exe. So for an example, if you are loading RenderSystem_Direct3D9_d (for a debug version of your application using plugins_d.cfg) then RenderSystem_Direct3D9_d.dll needs to be right there in the same folder with your .exe, and your .cfg files.
Tagada
Gnoblar
Posts: 7
Joined: Tue Feb 09, 2016 10:45 am

Re: Unregistering ResourceManager

Post by Tagada »

Thanks,

I had understood the need of having file.cfg in the correct relative folder, but your last reply was very helpfull with new informations about plugins.cfg.

what is shown through the difficulties related on this topic is two-fold :
first, (perhaps Ogre-community can help but it is not it's purpose) : Why this "f**" Visual Studio throw this exception while the execution outside of Visual Studio don't. (see my precedent post with the screenshot of Ogre interface);

second, the tutorial "set up your first application with Ogre", meaning that the user is an Ogre-absolute beginner even if he had years of programming behind him is missing the specific mention to well copy the necessary folders and files in order to avoid this exception error.
incidentaly, as i said precedently, the error message mentioning a path that was existing on an other computer (i.e. "D:\Work\...\OgreConfigFile.cpp" had never existed on my PC) seems totaly illogic and should be corrected. Unless this reflect that somewhere in the code of the tutorial, a string is really hard-filled with this path before the call to Load method, in which case the error message really reflect the path where the file is expected.
Anyway, to search (or to tell) about a path in the computer that had compiled the code makes no sense but makes confusion in minds.

I will try on the next hours/days to walk forward with the set up of this tutorial, copying the needed files and folders at the right place, and come back to say if it works or not.
Thanks again.
User avatar
c6burns
Beholder
Posts: 1512
Joined: Fri Feb 22, 2013 4:44 am
Location: Deep behind enemy lines
x 138

Re: Unregistering ResourceManager

Post by c6burns »

Tagada wrote:Why this "f**" Visual Studio throw this exception while the execution outside of Visual Studio don't. (see my precedent post with the screenshot of Ogre interface);
Visual Studio sets its own special working directory before running the exe and attaching the debugger. You can see and change this directory in:
Project Properties -> Configuration Properties -> Debugging -> Working Directory
Tagada wrote:the error message mentioning a path that was existing on an other computer (i.e. "D:\Work\...\OgreConfigFile.cpp" had never existed on my PC) seems totaly illogic and should be corrected. Unless this reflect that somewhere in the code of the tutorial, a string is really hard-filled with this path before the call to Load method, in which case the error message really reflect the path where the file is expected.
There is nothing hard coded. I have explained to you exactly what is happening and even posted sample code. *YOU* are instatiating a ConfigFile class and calling its load method. *YOU* are passing a parameter to this method which contains the path and filename of your resources.cfg. If that file cannot be found, an exception will be generated containing the filename and linenumber. This is wherever the file existed when you built the library, but it's irrelevant. There is no problem inside the ConfigFile class ... the problem is there is no resources.cfg in your working directory.
Tagada
Gnoblar
Posts: 7
Joined: Tue Feb 09, 2016 10:45 am

Re: Unregistering ResourceManager

Post by Tagada »

Working with the explanations of @c6burns, i founded some steps to go forward that should be usefull to others users of VS2015 working with Ogre :

As usually i created a new project and let VS2015 set the differents directories for me.
Here is the source of some missanderstandings.
Visual Studio (2015) creates :
- 1) a $(SolutionDir) which name end with the name I call my project (for ex. ...Studio2015\Projects\MyOgreProject)
But that is not the directory for the project : it's the directory for the Visual Studio 2015's solution;
- 2) a $(ProjectDir) which is composed from $(SolutionDir) added one more time with the name of my project :
for example ...Studio2015\Projects\MyOgreProject\MyOgreProject
And this is this directory $(ProjectDir) which is set by default as Working Directory for Visual Studio, but...
When building the Solution, Visual Studio 2015 creates files and subdirectories at :
$(SolutionDir)\Debug and $(SolutionDir)\Release with both the MyOgreProject.exe file ;
$(ProjectDir)\Debug and $(ProjectDir)\Release
in order to make Ogre working correctly from within Visual Studio 2015, all the .dll files have to be placed beside the .exe file (i.e $(SolutionDir)\Debug\MyOgreProject.exe), but not the .cfg files !

The .cfg files have to be placed in the directory defined in Visual Studio as "Working Directory" so by the defaults settings, the $(ProjectDir). In my case : $(ProjectDir)\resources_d.cfg and $(ProjectDir)\plugins_d.cfg ...
The plugins_d.cfg (and the plugins.cfg whitch is the same for Release version) defines a folder for the plugins :
this folder is relative to the path where the .exe file is placed, not from the working directory defined in Visual Studio (in which directory plugins_d.cfg is placed).
For example the plugins_d.cfg contains "PluginFolder=plugins" : that means Ogre will search for a directory named "plugins" inside the directory where the .exe is placed, so $(SolutionDir)\Debug\plugins
The same way is suited "resources_d.cfg" within which the paths are originaly set begining with "../../Media/", making Ogre expecting a Media directory in the parent of the parent directory of the .exe file.
As i want all the directories to stay within my solution root directory, I modified those paths to "../Media"

finaly, with the defaults directories set by Visual Studio 2015 we obtain the structure :

Code: Select all

- C:\Users\(yourUserName)\Documents\Visual Studio 2015\Projects\MyOgreProject   <-- [b][color=#008040]$(SolutionDir)[/color][/b]
                   \Debug\MyOgreProject[b][size=120].exe[/size][/b];
                   \Debug\ all the _d[b][size=120].dll[/size][/b] files;
                   \Debug\[b][size=120]plugins[/size][/b]\ all the plugins files defined inside plugins_d.cfg ;
                   \[b][size=120]Media[/size][/b]\  with all the files required inside resources.cfg ;
                   \MyOgreProject     <-- [b][color=#008040]$(ProjectDir)[/color][/b]
                                  \[b][size=120]resources.cfg[/size][/b]  and  resources_d.cfg ;
                                  \[b][size=120]plugins.cfg[/size][/b]  and plugins_d.cfg ;
                                  \Ogre.cfg and Ogre.log (writen by Ogre at runtime, see below);
                                  \Debug\ with files from and for Visual Studio
                                  \Release\ with files from and for Visual Studio
                   \Release\     <-- [color=#008040]the same folder as \Debug with .exe file, for Release version[/color]
Then the Ogre tutorial start up within Visual Studio 2015.
At this time I consider that the Exception Error FileNotFound had met a practical solution, but...
the mentions of unexistant paths ("D:\Work...") still persist within a code i haven't writen any line but, if i'm not wrong, is provided by Ogre3D.org.

Come back to ours directories : an other interesting event is that Ogre write a Ogre.cfg and a Ogre.log files in the directory $(ProjectDir) - the Working Directory defined in Visual Studio.
inside are interesting informations mentioning for example the files not found...
Sorry I have to left for a couple of hour. I will complete this post if someone ask me for.
Transporter
Minaton
Posts: 933
Joined: Mon Mar 05, 2012 11:37 am
Location: Germany
x 110

Re: Unregistering ResourceManager

Post by Transporter »

If you like, you can try my Microsoft Visual Studio project wizard which creates a working configuration set. You might have to correct the postbuild code, because you have spaces in your path names.

D:\Work is my build directory, so this path is set by VS in debug information database. If you debug into the code, VS is asking you about your file location.
Post Reply