How to run CEGUI with Irrlicht

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

dehseth
Just popping in
Just popping in
Posts: 8
Joined: Thu Aug 05, 2010 11:42

How to run CEGUI with Irrlicht

Postby dehseth » Fri Aug 06, 2010 12:43

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 ...... :)

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

Re: How to run CEGUI with Irrlicht

Postby Kulik » Fri Aug 06, 2010 13:29

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.

dehseth
Just popping in
Just popping in
Posts: 8
Joined: Thu Aug 05, 2010 11:42

Re: How to run CEGUI with Irrlicht

Postby dehseth » Fri Aug 06, 2010 13:38

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:

Code: Select all

#define CEGUI_STATIC

User avatar
emarcotte
Quite a regular
Quite a regular
Posts: 55
Joined: Fri Dec 26, 2008 14:30
Contact:

Re: How to run CEGUI with Irrlicht

Postby emarcotte » Fri Aug 06, 2010 14:22

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.
Last edited by emarcotte on Fri Aug 06, 2010 15:35, edited 1 time in total.

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

Re: How to run CEGUI with Irrlicht

Postby Kulik » Fri Aug 06, 2010 15:14

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...

dehseth
Just popping in
Just popping in
Posts: 8
Joined: Thu Aug 05, 2010 11:42

Re: How to run CEGUI with Irrlicht

Postby dehseth » Sun Aug 08, 2010 18:16

well ok let's not use static linking for now.. 8)

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 :)

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

Re: How to run CEGUI with Irrlicht

Postby Jamarr » Mon Aug 09, 2010 16:25

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.
If somebody helps you by replying to your thread, upvote him/her as a thanks! Make sure to include your CEGUI.log and everything you tried when posting! And remember that we are not magicians!

lymantok
Not too shy to talk
Not too shy to talk
Posts: 39
Joined: Sun May 13, 2007 03:24

Re: How to run CEGUI with Irrlicht

Postby lymantok » Sat Aug 14, 2010 22:06

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.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 17 guests