Page 1 of 1

Ogre 3d and cegui runtime error

Posted: Fri Jul 04, 2014 00:22
by JohnBoyMan
Hello i am trying to get cegui 0.8.3 to work with ogre. I have added the CEGUIBase-0_d.lib; to my compilers additional dependencies. I have also added the path to the CEGUI inclue file for all of the headers like CEGUI.h. I have also added #include "cegui.h" to the top of my project.

I wrote this code into the CreateScene() of my game.

Code: Select all


         WindowManager& winMgr = WindowManager::getSingleton();
 
         Window* myRoot = winMgr.createWindow( "DefaultWindow", "root" );
         System::getSingleton().getDefaultGUIContext().setRootWindow( myRoot );

         FrameWindow* fWnd = static_cast<FrameWindow*>(
         winMgr.createWindow( "TaharezLook/FrameWindow", "testWindow" ));

         myRoot->addChild( fWnd );

         position a quarter of the way in from the top-left of parent.
         fWnd->setPosition( UVector2( UDim( 0.25f, 0.0f ), UDim( 0.25f, 0.0f ) ) );
          set size to be half the size of the parent
         fWnd->setSize( USize( UDim( 0.5f, 0.0f ), UDim( 0.5f, 0.0f ) ) );

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




This error message pops up during early runtime of my ogre application.


Assertion Failed!
Program: ...dio 2012\Projects\game2014\Debug\CEGUIBase-0_d.dll
File:C:\Users\john\Desktop\New Folder (5)\cegui.../Singleton.h
Line:79

Expression: ms_Singleton

For more information on how you program can cause an assertion
failure,see the Visual C++ documentation on asserts

(Press Retry to debug the application - JIT must be enabled)



there are no errors reported in my debugger.

does anyone know the cause of this? thanks

Re: Ogre 3d and cegui runtime error

Posted: Fri Jul 04, 2014 02:41
by Nickenstein79
You will need to place the CEGUI dlls that you built into the folder that your game.exe lives in. (Your game is linking correctly with the CEGUI.libs, but still requires the runtime DLLs that you built.)

files like:

CEGUIBase-0.dll
CEGUIOgreRenderer-0.dll
CEGUISILLYImageCodec.dll

etc...


Also, you will want to put debug versions in there if you want to debug CEGUI. They have '_d' in the name (Example: CEGUIBase-0_d.dll).
(Your debugger will have an easier time showing proper debug info if you also copy the corresponding *.pdb and *.ilk files)

THEN...

Those CEGUI-dlls in-turn are going to rely on some of the CEGUI-dependencies dlls, (Glew.dll, FreeType.dll, LibExpat.dll, and so on...) so they will need to be in the folder with your game.exe too.

Re: Ogre 3d and cegui runtime error

Posted: Fri Jul 04, 2014 04:31
by JohnBoyMan
thanks does ogre still use.
CEGUIOgreRenderer-0.dll

I cant find it in my cegui dependencies or in cegui.
cant find either of these
CEGUIOgreRenderer-0.dll
CEGUISILLYImageCodec.dll

Re: Ogre 3d and cegui runtime error

Posted: Fri Jul 04, 2014 04:55
by Nickenstein79
JohnBoyMan wrote:cant find either of these
CEGUIOgreRenderer-0.dll
CEGUISILLYImageCodec.dll


Those are optional things that you have to toggle-ON in the cmake settings of CEGUI if you want your cegui.sln to build them. (The DLL files for these will end up in the /bin folder of your CEGUI-build folder if you are building them).

Make sure that the following cmake variables are toggle-ON.
CEGUI_BUILD_RENDERER_OGRE
CEGUI_BUILD_IMAGECODEC_SILLY (This is needed for CEGUI to be able to load most texture/image formats.)

In my setup I have all of the directX/Opengl/Ogre Renderers toggled-ON (Except for OpenGLES/Irlicht as I don't need/use those).

Re: Ogre 3d and cegui runtime error

Posted: Fri Jul 04, 2014 07:03
by Ident