Page 1 of 1
How to run CEGUI with Irrlicht
Posted: Fri Aug 06, 2010 12:43
by dehseth
I am having troubles with compiling my code. I just compiled static libraries of CEGUI and Irrlicht Renderer libs...
And I referenced the scr/include folder to my project. And I include header CEGUI.h... But it's not enough.... IrrlichtRenderer is not visible to my project:
Code: Select all
CEGUI::IrrlichtRenderer* myRenderer = new CEGUI::IrrlichtRenderer(g_device, true );
I also tried to add this path
include\RendererModules\Irrlicht to my code and it says this function gets only one parameter (irrlicht device reference)....
So I decided to ask you guys, should I manually add this folder and IrrlichtRenderer header file or is there any other way (like defining a IRRLICHT_RENDERER)? And may you show me a working demo code which contains latest CEGUI and Irrlicht 1.7.1?
Thank you ......
Re: How to run CEGUI with Irrlicht
Posted: Fri Aug 06, 2010 13:29
by Kulik
CEGUI.h doesn't include renderer modules. You need to include "RendererModules/Irrlicht/CEGUIIrrlichtRenderer.h". You don't need to add it to path. But you probably will need to add irrlicht includes to path.
Re: How to run CEGUI with Irrlicht
Posted: Fri Aug 06, 2010 13:38
by dehseth
ok I have added these two:
Code: Select all
#include <CEGUI.h>
#include <CEGUIIrrlichtRenderer.h>
#pragma comment(lib, "CEGUIBase_Static_d.lib")
#pragma comment(lib, "CEGUIIrrlichtRenderer_Static_d.lib")
CEGUI::IrrlichtRenderer& g_guiRenderer = CEGUI::IrrlichtRenderer::bootstrapSystem(*g_device);
And now I have other problems:
Error 7 error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall CEGUI::System::renderGUI(void)" (__imp_?renderGUI@System@CEGUI@@QAEXXZ) referenced in function "public: void __thiscall CChessGame::Run(class irr::scene::ICameraSceneNode *)" (?Run@CChessGame@@QAEXPAVICameraSceneNode@scene@irr@@@Z) ChessGame.obj
Error 8 error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class CEGUI::System & __cdecl CEGUI::System::getSingleton(void)" (__imp_?getSingleton@System@CEGUI@@SAAAV12@XZ) referenced in function "public: void __thiscall CChessGame::Run(class irr::scene::ICameraSceneNode *)" (?Run@CChessGame@@QAEXPAVICameraSceneNode@scene@irr@@@Z) ChessGame.obj
Error 6 error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class CEGUI::IrrlichtRenderer & __cdecl CEGUI::IrrlichtRenderer::bootstrapSystem(class irr::IrrlichtDevice &)" (__imp_?bootstrapSystem@IrrlichtRenderer@CEGUI@@SAAAV12@AAVIrrlichtDevice@irr@@@Z) referenced in function _main ApplicationChesster.obj
So smt is missing right? What should I include to get rid of these errors??
2. And I want to use static library, not DLL...... so I tried this but didn't work out:
Re: How to run CEGUI with Irrlicht
Posted: Fri Aug 06, 2010 14:22
by emarcotte
Looks like you're not linking to the render module perhaps? You need to link to both CEGUIBase and whichever module you use.
Edit: I'm a moron. I didn't notice the pragma for libs. Nevermind me.
Re: How to run CEGUI with Irrlicht
Posted: Fri Aug 06, 2010 15:14
by Kulik
Something is wrong because static libraries don't use the __declspec(dllimport)/dllexport. Try to define CEGUI_STATIC before you include any CEGUI include files.
I must say I don't work with static CEGUI, so I am not sure...
Re: How to run CEGUI with Irrlicht
Posted: Sun Aug 08, 2010 18:16
by dehseth
well ok let's not use static linking for now..
but cannot run cegui with dll's either. source code compiles with no error but when I try to run it i get this:
Unhandled exception at 0x7c812afb in ChessterD.exe: Microsoft C++ exception: CEGUI::GenericException at memory location 0x0012e310..this is two lines of code, app crashes at first line:
Code: Select all
CEGUI::IrrlichtRenderer& myRenderer = CEGUI::IrrlichtRenderer::create(*g_device);
CEGUI::System::create(myRenderer);
I also tried this:
Code: Select all
CEGUI::IrrlichtRenderer& g_guiRenderer = CEGUI::IrrlichtRenderer::bootstrapSystem(*g_device);
any ideas? any body using irrlicht? any example code??
I figured out the problem, I needed this DLL: CEGUIExpatParser_d.dll.. Just copied this to run dir and it finally worked
Re: How to run CEGUI with Irrlicht
Posted: Mon Aug 09, 2010 16:25
by Jamarr
Just for reference, but I noticed the exception message you posted is the standard windows error handler; this provides no insight into the reason the exception was thrown. If you wrap try/catch around CEGUI code you can display the actual error message; which in this case would have told you the missing module name. Also, CEGUI exception messages can generally be found in the CEGUI.log file.
Re: How to run CEGUI with Irrlicht
Posted: Sat Aug 14, 2010 22:06
by lymantok
I use vc8 with CEGUI 0.7.1 and Irrlicht 1.7.1. It works fine. All my issues have been related to my environment setting up the vc8 includes/libs/dlls properly for "release" and "debug" including building CEGUI properly from soruce for "release" and "debug". The code for bootstrap approach I use which works fine is:
IrrlichtDevice* device;
device = createDevice( m_DeviceType, windowSize, bits, fullscreen, stencilbuffer, vsync, 0);
CEGUI::IrrlichtRenderer& m_myRenderer = CEGUI::IrrlichtRenderer::bootstrapSystem( *device );
All the best.