Page 1 of 1

Can't run cegui + ogre

Posted: Sat Dec 13, 2008 16:23
by aleksk8
I am trying to compile and launch cegui+ogre for the whole day and nothing is working... I read lot of posts with many solutions and what I did:

1. I deleted any cegui/ogre includes/sources/dlls/libs, i mean everything...
2. I downloaded and installed OgreSDK v1.6.0 for VC9 (i am using visual c++ 2008 express edition)
3. I downloaded and installed CEGUI-SDK-0.6.2-vc9
4. Both OgreSDK and CEGUISDK with precompiled libs.
5. I deleted all files in OgreSDK/include/CEGUI and copied there files from CEGUISDK/include
6. I deleted OGRESDK/lib/CEGUIBase_d.lib and CEGUIBase.lib
7. I deleted OGRESDK/bin/release/CEGUIBase.dll CEGUIExpatParser.dll CEGUIFalagardWRBase.dll
8. I copied all deleted files above from CEGUISDK

9. I copied CEGUI dll's to my project exe-file dir...
10. my project settings:



Additional Include Dirs


At the start of my project which is a sample from ogresdk:

#include <CEGUI/CEGUIImageset.h>
#include <CEGUI/CEGUISystem.h>
#include <CEGUI/CEGUILogger.h>
#include <CEGUI/CEGUISchemeManager.h>
#include <CEGUI/CEGUIWindowManager.h>
#include <CEGUI/CEGUIWindow.h>
#include <CEGUI/CEGUIPropertyHelper.h>
#include <CEGUI/elements/CEGUICombobox.h>
#include <CEGUI/elements/CEGUIListbox.h>
#include <CEGUI/elements/CEGUIListboxTextItem.h>
#include <CEGUI/elements/CEGUIPushButton.h>
#include <CEGUI/elements/CEGUIScrollbar.h>
#include "OgreCEGUIRenderer.h"
#include "OgreCEGUIResourceProvider.h"

#include "ExampleApplication.h"

11. All compiles and links smoothly but at the run time I get message that error occured during loading process:

The procedure entry point ??0InvalidRequestExeption@CEGUI@@QAE@ABVString@1@@Z could not be located in the dynamic link library CEGUIBase_d.dll

Whats wrong and how I can solve this problem?
For example samples from CEGUISDK using glut compiled and ran without any problems so I assume that somthing is wrong in ogre files OgreCEGUIRenderer.h or "OgreCEGUIRenderer.h"

And before I did all those points I used CEGUI with libs,dlls and includes which were included in OGRESDK and everything was ok...
But since OGRESDK does not provide any Lua modules I want to use the latest CEGUI libs from the SDK with OGRE

Posted: Sat Dec 13, 2008 20:28
by kewur
i'll tell you 2 things about linking in VS

if the compiler complains about some header like "SDL.h" you can fix it under C/C++->general->Additional Include Directories

if the compiler complains about some .dll you have to indicate where the lib files are. in

Linker->General->Additional Library Directories

you gotto be telling something wrong there. Check where your missing .lib

(i wrote these for future inconviences that may occur)

but i think your problem is completly diffrent and simple (if im right)

You need to put the .dll files in the same folder as the executable so the executable may find the necessery .dlls

Posted: Sat Dec 13, 2008 23:01
by aleksk8
I did it but it seems that OgreCEGUIRenderer is using some InvalidRequestExeption method which was on the old version of CEGUIBase.dll, and in the new version som1 decided to not implement this method and thats why it cant find it. I mean this method is definded in OgreCEGUIrendere.lib but it is missing in CEGUIBase.dll

Well as I checked those 3 files, InvalidRequestExeption appears only in OgreCEGUIResourceProvider.cpp... that means i could try to comment it and recompile ogreguirenderer.lib but I would have to download OgreSource with some VC projects inside... there must be some other way... maybe som1 just have working (with latest CEGUI) file "ogreguirenderer.lib"?

And I was wondering why CEGUI does not provide renderer module for ogre while it provides default d3d/opengl/irrlicht etc renderers...

Posted: Sun Dec 14, 2008 12:13
by CrazyEddie

If you use the prebuilt Ogre SDK you are limited to using the version of CEGUI that the Ogre guys provide with it. To use an updated version of CEGUI requires, as you already suspect, that the renderer module is rebuilt against the newer version of CEGUI.

And I was wondering why CEGUI does not provide renderer module for ogre while it provides default d3d/opengl/irrlicht etc renderers

Our renderer module for Ogre was transplanted from our code tree into the Ogre code tree in order to simplify a circular dependency (which used to mean you had to build things twice). Though I acknowledge that in scenarios like yours, it would be simpler to upgrade CEGUI if the renderer module was still in our code tree.


Posted: Sun Dec 14, 2008 14:45
by aleksk8
Okay I managed to do it :) - for those with same problem here is what I have done:

1. Download OGRE source (for me for VC 2008 (9))
2. Download Prebuilt OgreDependencies
3. Download Prebuild OgreSDK
4. Download latest prebuilt CEGUI SDK

5. extract dependencies to have dir like this: ogre_src/dependencies/
6. copy OGRESDK/lib/OgreMain_d.lib to ogre_src/lib
7. copy (and overwrite) CEGUIBase_d.lib from CEGUISDK to ogre_src/dependencies/lib/debug
8. copy all CEGUI includes from CEGUISDK to ogre_src/dependencies/include/CEGUI

9. from ogre_src/ open VC project - for me Ogre_vc9.sln
10. on the left "panel" (projects (or modules whatever) list) find OgreGUIRenderer project
11. right click it choose project only/build OgreGuiRenderer
12. As build process is finished u should have OgreGUIRenderer_d.dll, OgreGUIRenderer_d.lib

13. U have to replace all files OgreGUIRenderer_d.dll/lib in ogre SDK by those new files...
14. And it should work like on my pc ;)

point no. 6 is just to avoid building the whole OgreEngine (i mean OgreMain_d.lib) - its okay cauze OgreGUIRenderer only references to this lib and we can use our one from SDK...

I dunno how to make non-debug versions of libs cauze i am lame ^^

enjoy latest CEGUI ;)

thanks for responses guys

Posted: Sun Dec 14, 2008 16:37
by aleksk8
Now I have next problem: my app crashes when I try to execute any lua script

I initialize CEGUI like this

Code: Select all

mRenderer = new CEGUI::OgreCEGUIRenderer(mWindow, Ogre::RENDER_QUEUE_OVERLAY, false, 3000, mSceneMgr);
      CEGUI::LuaScriptModule* script_module = new CEGUI::LuaScriptModule();
       mSystem = new CEGUI::System(mRenderer,0,0,script_module);

when I try to use CEGUI::System::getSingleton().executeScriptFile("test.lua");

program crashes and in cegui.log:

14/12/2008 17:35:41 (Error) CEGUI::GenericException in file d:\temp\cegui-0.6.2-vc9\src\ceguisystem.cpp(603) : System::executeScriptFile - An exception was thrown during the execution of the script file.

in test.lua i have:

local logger=CEGUI.Logger:getSingleton()

whats wrong?

Posted: Sun Dec 14, 2008 18:57
by CrazyEddie
This exception is likely not coming from the lua side of things, which means it's probably a resource loading issue.

Have you done the required set up for resource locations and default resource groups? If not then I'd guess that it can't find the file. You need to set up your resource group locations as you normally would under Ogre, then set default resource groups in CEGUI for the various CEGUI component resources. If you have all your CEGUI resources in the same place, all under one group, you can use CEGUI::ResourceProvider::setDefaultResourceGroup to set a 'master' default for all resource types.


Posted: Sun Dec 14, 2008 19:04
by aleksk8
Hehe I just managed to solve this ;) - As u say I (accidently ;) looked at ogre.log and there were exeption "FileNotFound" for "test.lua" ;) the only thing I had to do was to add new FileSystem path to resources.cfg :) and its working now properly... but I didnt used any CEGUI::ResourceProvider::setDefaultResourceGroup - so i think its not required for now, the only tjing is ogre resource path... well not required FOR NOW ;) - if somthing will go wrong I will think about it ,thanks for reply