[Exception] existing layout file is not found

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

ingo99
Just popping in
Just popping in
Posts: 6
Joined: Thu Apr 09, 2009 14:53

[Exception] existing layout file is not found

Postby ingo99 » Thu Apr 09, 2009 19:42

Hi,

I just attempt my first test application with CEGUI but I have some trouble with my code.
As far as I understand this should work:

Code: Select all

    DefaultResourceProvider* rp = static_cast<DefaultResourceProvider*>(System::getSingleton().getResourceProvider());

    rp->setResourceGroupDirectory("schemes", "resource/gui/schemes/");
    rp->setResourceGroupDirectory("imagesets", "resource/gui/imagesets/");
    rp->setResourceGroupDirectory("fonts", "resource/gui/fonts/");
    rp->setResourceGroupDirectory("layouts", "resource/gui/layouts/");
    rp->setResourceGroupDirectory("looknfeels", "resource/gui/looknfeel/");

    Scheme::setDefaultResourceGroup("schemes");
    Imageset::setDefaultResourceGroup("imagesets");
    Font::setDefaultResourceGroup("fonts");
    WidgetLookManager::setDefaultResourceGroup("layouts");
    WindowManager::setDefaultResourceGroup("looknfeels");

   Window* myRoot = WindowManager::getSingleton().loadWindowLayout("test.layout");
   System::getSingleton().setGUISheet(myRoot);

this compiled successfully, but when I executed the binary I got an exception:

Code: Select all

09/04/2009 21:33:57 (InfL1)   CEGUI::System singleton created.
09/04/2009 21:33:57 (InfL1)   ---- CEGUI System initialisation completed ----
09/04/2009 21:33:57 (InfL1)   ---- Version 0.5.0 ----
09/04/2009 21:33:57 (InfL1)   ---- Renderer module is: CEGUI::OpenGLRenderer - Official OpenGL based renderer module for CEGUI ----
09/04/2009 21:33:57 (InfL1)   ---- XML Parser module is: CEGUI::XercesParser - Official Xerces-C++ based parser module for CEGUI ----
09/04/2009 21:33:57 (InfL1)   ---- Scripting module is: None ----
09/04/2009 21:33:57 (InfL1)   XercesParser::initialiseSchema - Attempting to load schema from file 'GUILayout.xsd'.
09/04/2009 21:33:57 (InfL1)   XercesParser::initialiseSchema - XML schema file 'GUILayout.xsd' has been initialised.
09/04/2009 21:33:57 (Error)   Exception: DefaultResourceProvider::load - test.layout does not exist
09/04/2009 21:33:57 (Error)   XercesParser::parseXMLFile - An unexpected error occurred while parsing XML file 'test.layout'.
09/04/2009 21:33:57 (Error)   WindowManager::loadWindowLayout - loading of layout from file 'test.layout' failed.

I copied the file to every possible location but it's still not found.

Whats the problem here?

btw. I'm working with Debian (=> old packages), therefore my CEGUI is outdated.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Fri Apr 10, 2009 09:13

Hi,

Two things...

First you have your WidgetLookManager and WindowManager default resource group setting functions reveresed, so that's why it can't find the file.

Second, since your layout will likely contain references to specific window types with mapped skins, before loading the layout you should load and appropriate scheme and maybe setup some defaults (as mentioned here: http://www.cegui.org.uk/wiki/index.php/ ... asic_Files).

HTH

CE.

ingo99
Just popping in
Just popping in
Posts: 6
Joined: Thu Apr 09, 2009 14:53

Postby ingo99 » Fri Apr 10, 2009 10:29

ok I switched the WidgetLookManager and WindowManager ald loaded some defaults, but it's still broken
10/04/2009 12:17:55 (InfL1) ---- CEGUI System initialisation completed ----
10/04/2009 12:17:55 (InfL1) ---- Version 0.5.0 ----
10/04/2009 12:17:55 (InfL1) ---- Renderer module is: CEGUI::OpenGLRenderer - Official OpenGL based renderer module for CEGUI ----
10/04/2009 12:17:55 (InfL1) ---- XML Parser module is: CEGUI::XercesParser - Official Xerces-C++ based parser module for CEGUI ----
10/04/2009 12:17:55 (InfL1) ---- Scripting module is: None ----
10/04/2009 12:17:55 (InfL1) Attempting to load Scheme from file 'resource/gui/schemes/TaharezLook.scheme'.
10/04/2009 12:17:55 (InfL1) XercesParser::initialiseSchema - Attempting to load schema from file 'GUIScheme.xsd'.
10/04/2009 12:17:55 (InfL1) XercesParser::initialiseSchema - XML schema file 'GUIScheme.xsd' has been initialised.
10/04/2009 12:17:55 (Error) Exception: DefaultResourceProvider::load - resource/gui/schemes/TaharezLook.scheme does not exist
10/04/2009 12:17:55 (Error) XercesParser::parseXMLFile - An unexpected error occurred while parsing XML file 'resource/gui/schemes/TaharezLook.scheme'.
10/04/2009 12:17:55 (Error) Scheme::Scheme - loading of Scheme from file 'resource/gui/schemes/TaharezLook.scheme' failed.


Why does the error say 'resource/gui/schemes/TaharezLook.scheme does not exist' when it actually does?
How should I find my mistakes when the 'exceptions' throw wrong messages??

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Fri Apr 10, 2009 10:40

Why come here and post inflammatory messages? Do you intentionally try and wind me up?

The message is not wrong - your code is wrong. But since you did not post the code where you load the scheme, how the hell do you expect to get help? I'm not bloody psychic you know.

Jeez, what a piss-poor attitude some of you shitters have. In the future I'll just not bother with time wasters like you.

CE.

ingo99
Just popping in
Just popping in
Posts: 6
Joined: Thu Apr 09, 2009 14:53

Postby ingo99 » Fri Apr 10, 2009 11:22

To be honest I just want to get an impression of CEGUI and copied some code from the wiki and the samples of the SDK.

I was searching for an easy GUI for a project and just making my first experiences with CEGUI. When you are familiar with SDL, OpenGL, wxWidgets,... the structure of the CEGUI framework is not really intuitive and easy to understand like the others.

My intention was not and is not to offend you!

After your post I modified my code how you told me and how I described:
Its nearly the same you see above but the WidgetLookManager and WindowManager are switched and I inserted the stuff from the wiki to load the defaults after I set the default resource groups.

I thought 'Beginners' would get help here and I just misunderstand an error, but it seems you misconceived my questions.

EDIT: Now I did it this way:

Code: Select all

    DefaultResourceProvider* rp = static_cast<DefaultResourceProvider*>(System::getSingleton().getResourceProvider());

    rp->setResourceGroupDirectory("schemes", "resource/gui/schemes/");
    rp->setResourceGroupDirectory("imagesets", "resource/gui/imagesets/");
    rp->setResourceGroupDirectory("fonts", "resource/gui/fonts/");
    rp->setResourceGroupDirectory("looknfeels", "resource/gui/looknfeel/");
    rp->setResourceGroupDirectory("layouts", "resource/gui/layouts/");

    Scheme::setDefaultResourceGroup("schemes");
    Imageset::setDefaultResourceGroup("imagesets");
    Font::setDefaultResourceGroup("fonts");
    WindowManager::setDefaultResourceGroup("looknfeels");
    WidgetLookManager::setDefaultResourceGroup("layouts");

    Imageset* taharezImages = ImagesetManager::getSingleton().createImageset("TaharezLook.imageset");

    System::getSingleton().setDefaultMouseCursor(&taharezImages->getImage("MouseArrow"));

    FontManager::getSingleton().createFont("Commonwealth-10.font");

    WidgetLookManager::getSingleton().parseLookNFeelSpecification("TaharezLook.looknfeel");

    SchemeManager::getSingleton().loadScheme("TaharezLookWidgets.scheme");

    WindowManager& winMgr = WindowManager::getSingleton();

    DefaultWindow* root = (DefaultWindow*)winMgr.createWindow("DefaultWindow", "Root");

    System::getSingleton().setGUISheet(root);

    FrameWindow* wnd = (FrameWindow*)winMgr.createWindow("TaharezLook/FrameWindow", "Demo Window");

    root->addChildWindow(wnd);

    wnd->setPosition(UVector2(cegui_reldim(0.25f), cegui_reldim( 0.25f)));
    wnd->setSize(UVector2(cegui_reldim(0.5f), cegui_reldim( 0.5f)));

    wnd->setMaxSize(UVector2(cegui_reldim(1.0f), cegui_reldim( 1.0f)));
    wnd->setMinSize(UVector2(cegui_reldim(0.1f), cegui_reldim( 0.1f)));

    wnd->setText("Hello World!");


The application crashes and the CEGUI.log says:
10/04/2009 13:34:54 (InfL1) ---- CEGUI System initialisation completed ----
10/04/2009 13:34:54 (InfL1) ---- Version 0.5.0 ----
10/04/2009 13:34:54 (InfL1) ---- Renderer module is: CEGUI::OpenGLRenderer - Official OpenGL based renderer module for CEGUI ----
10/04/2009 13:34:54 (InfL1) ---- XML Parser module is: CEGUI::XercesParser - Official Xerces-C++ based parser module for CEGUI ----
10/04/2009 13:34:54 (InfL1) ---- Scripting module is: None ----
10/04/2009 13:34:54 (InfL1) Attempting to create an Imageset from the information specified in file 'TaharezLook.imageset'.
10/04/2009 13:34:54 (InfL1) XercesParser::initialiseSchema - Attempting to load schema from file 'Imageset.xsd'.
10/04/2009 13:34:54 (InfL1) XercesParser::initialiseSchema - XML schema file 'Imageset.xsd' has been initialised.
10/04/2009 13:34:54 (InfL1) Started creation of Imageset from XML specification:
10/04/2009 13:34:54 (InfL1) ---- CEGUI Imageset name: TaharezLook
10/04/2009 13:34:54 (InfL1) ---- Source texture file: TaharezLook.tga in resource group: (Default)

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Fri Apr 10, 2009 11:44

Hi,

It's not that I get 'offended', but I do get annoyed ;) And what annoys me is when users who are obviously new to CEGUI see fit to critique something that they - by their very nature as newcomers - do not yet understand.

After you have some experience with CEGUI, by all means feel free to make any comments you like; as you'll see elsewhere I'm often the first to agree that some exception messages are not as helpful as they could be, or some other aspect of the code or system is lacking. Informed and constructive criticism is essential, comments borne out of frustration - while understandable - are not helpful and ideally should not be posted, thanks ;)

With reference to your original issue, the clue to your error is in fact in the exception message, though it takes experience to spot it. I believe the error is that you have passed relative path information to the 'load' function, like:

Code: Select all

schemeMgr->loadScheme( "resource/gui/schemes/TaharezLook.scheme" );

When what you should put is:

Code: Select all

schemeMgr->loadScheme( "TaharezLook.scheme" );


I know this because the exception will only contain the info passed by client code as opposed to the version with the resource group path added.

For your new issue, from the edit, what is the specific 'crash'? A crash could be anything, so we need to know what that is in terms of segfault or what?

CE.

ingo99
Just popping in
Just popping in
Posts: 6
Joined: Thu Apr 09, 2009 14:53

Postby ingo99 » Fri Apr 10, 2009 12:02

ok, with the fist issue i tried both

Code: Select all

schemeMgr->loadScheme( "resource/gui/schemes/TaharezLook.scheme" );

Code: Select all

schemeMgr->loadScheme( "TaharezLook.scheme" );

does not matter the error in cegui.log says it does not exist.

according to my second issue you are right,
Exit code 11 is segmentation fault.

which is initated by

Code: Select all

    Imageset* taharezImages = ImagesetManager::getSingleton().createImageset("TaharezLook.imageset");

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Mon Apr 13, 2009 08:31

With regard to the first issue, if the system is reporting the file is not there, then the file is not there. If the file is in fact there, then something else is not right. I would urge you to try to resolve the existing issue rather than trying to side-step it by fixing symptoms rather than the problem itself. Usually that just leads onto further pain and frustration down the line, which brings us neatly onto the second issue...

Please post some kind of backtrace, a segfault (or any other exception) without some kind of context information means nothing ;)

CE.

Jamarr
CEGUI MVP
CEGUI MVP
Posts: 812
Joined: Tue Jun 03, 2008 23:59
Location: USA

Postby Jamarr » Tue Apr 14, 2009 18:25

Strike 1:
Why does the error say 'resource/gui/schemes/TaharezLook.scheme does not exist' when it actually does?
How should I find my mistakes when the 'exceptions' throw wrong messages??


Strike 2:
I was searching for an easy GUI for a project and just making my first experiences with CEGUI. When you are familiar with SDL, OpenGL, wxWidgets,... the structure of the CEGUI framework is not really intuitive and easy to understand like the others.


Why come here and post rude, nonsensical thoughts? I'm surprised CE is still trying to help you.

Your problem is very simple. CEGUI cannot find the file. There are only 3 possible reasons for this:
1 - the file does not actually exists
2 - you did not correctly tell CEGUI how to find the file
3 - you do not understand the ResourceProvider you are using

Now I have to ask, since this has not been mentioned, where did you acquire CEGUI from? You said you are using an older version, so I can only assume this older version came pre-packaged with another library? Are you sure this library is using the 'DefaultResourceProvider'? If you are using something like OGRE, that uses a custom ResourceProvider, you are bound to run into issues trying to use it like you would the default RP.

And, although I haven't used v0.5, CEGUI v0.6+ has been as easy, if not easier, to understand and use as OpenGL, wxWidgets, or any other 3rd-party API. I can tell you first hand that CEGUI is CAKE compared to some of the other middleware out there. Take RenderWare for instace (not that I've used it in 4yrs), but it is/was one of the worst documented APIs I've ever seen and used...and you had to pay for it.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 26 guests