Compiling problem - what am I missing?

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

50p
Just popping in
Just popping in
Posts: 13
Joined: Mon May 18, 2009 00:50

Compiling problem - what am I missing?

Postby 50p » Mon May 18, 2009 01:11

I'm trying to make a tool very similar to LayoutEditor for Multi Theft Auto : DM. It's a multi-player mod for GTA:San Andreas and uses your GUI system. I want to use CEGUI, their theme and export the GUI created for their Lua scripts.

So far, I've followed a really old tutorial on how to use OpenGL with MFC (can be found here). Now, I'm trying to render CEGUI in that OpenGL rendering window. I followed the first tutorial on your wiki but I seem to be missing something.

What I did was, added these 2 lines in my header file:

Code: Select all

#include <CEGUI.h>
#include <openglrenderer.h>

and these 2 where I create my OpenGL rendering window:

Code: Select all

   myRenderer = new CEGUI::OpenGLRenderer( 0 );
   new CEGUI::System( myRenderer );

(of course myRenderer is defined in my class as CEGUI::OpenGLRenderer pointer)

When I try compiling I get 31 unresolved externals which are:
OpenGLControl.obj : error LNK2001: unresolved external symbol "public: virtual class CEGUI::ResourceProvider * __thiscall CEGUI::Renderer::createResourceProvider(void)" (?createResourceProvider@Renderer@CEGUI@@UAEPAVResourceProvider@2@XZ)
OpenGLControl.obj : error LNK2001: unresolved external symbol "public: virtual unsigned int __thiscall CEGUI::OpenGLRenderer::getVertScreenDPI(void)const " (?getVertScreenDPI@OpenGLRenderer@CEGUI@@UBEIXZ)
OpenGLControl.obj : error LNK2001: unresolved external symbol "public: virtual unsigned int __thiscall CEGUI::OpenGLRenderer::getHorzScreenDPI(void)const " (?getHorzScreenDPI@OpenGLRenderer@CEGUI@@UBEIXZ)
OpenGLControl.obj : error LNK2001: unresolved external symbol "public: virtual unsigned int __thiscall CEGUI::OpenGLRenderer::getMaxTextureSize(void)const " (?getMaxTextureSize@OpenGLRenderer@CEGUI@@UBEIXZ)
OpenGLControl.obj : error LNK2001: unresolved external symbol "public: virtual class CEGUI::Rect __thiscall CEGUI::OpenGLRenderer::getRect(void)const " (?getRect@OpenGLRenderer@CEGUI@@UBE?AVRect@2@XZ)
OpenGLControl.obj : error LNK2001: unresolved external symbol "public: virtual class CEGUI::Size __thiscall CEGUI::OpenGLRenderer::getSize(void)const " (?getSize@OpenGLRenderer@CEGUI@@UBE?AVSize@2@XZ)
OpenGLControl.obj : error LNK2001: unresolved external symbol "public: virtual float __thiscall CEGUI::OpenGLRenderer::getHeight(void)const " (?getHeight@OpenGLRenderer@CEGUI@@UBEMXZ)
OpenGLControl.obj : error LNK2001: unresolved external symbol "public: virtual float __thiscall CEGUI::OpenGLRenderer::getWidth(void)const " (?getWidth@OpenGLRenderer@CEGUI@@UBEMXZ)
OpenGLControl.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall CEGUI::OpenGLRenderer::isQueueingEnabled(void)const " (?isQueueingEnabled@OpenGLRenderer@CEGUI@@UBE_NXZ)
OpenGLControl.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall CEGUI::OpenGLRenderer::destroyAllTextures(void)" (?destroyAllTextures@OpenGLRenderer@CEGUI@@UAEXXZ)
OpenGLControl.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall CEGUI::OpenGLRenderer::destroyTexture(class CEGUI::Texture *)" (?destroyTexture@OpenGLRenderer@CEGUI@@UAEXPAVTexture@2@@Z)
OpenGLControl.obj : error LNK2001: unresolved external symbol "public: virtual class CEGUI::Texture * __thiscall CEGUI::OpenGLRenderer::createTexture(void)" (?createTexture@OpenGLRenderer@CEGUI@@UAEPAVTexture@2@XZ)
OpenGLControl.obj : error LNK2001: unresolved external symbol "public: virtual class CEGUI::Texture * __thiscall CEGUI::OpenGLRenderer::createTexture(class CEGUI::String const &,class CEGUI::String const &)" (?createTexture@OpenGLRenderer@CEGUI@@UAEPAVTexture@2@ABVString@2@0@Z)
OpenGLControl.obj : error LNK2001: unresolved external symbol "public: virtual class CEGUI::Texture * __thiscall CEGUI::OpenGLRenderer::createTexture(float)" (?createTexture@OpenGLRenderer@CEGUI@@UAEPAVTexture@2@M@Z)
OpenGLControl.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall CEGUI::OpenGLRenderer::setQueueingEnabled(bool)" (?setQueueingEnabled@OpenGLRenderer@CEGUI@@UAEX_N@Z)
OpenGLControl.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall CEGUI::OpenGLRenderer::clearRenderList(void)" (?clearRenderList@OpenGLRenderer@CEGUI@@UAEXXZ)
OpenGLControl.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall CEGUI::OpenGLRenderer::doRender(void)" (?doRender@OpenGLRenderer@CEGUI@@UAEXXZ)
OpenGLControl.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall CEGUI::OpenGLRenderer::addQuad(class CEGUI::Rect const &,float,class CEGUI::Texture const *,class CEGUI::Rect const &,class CEGUI::ColourRect const &,enum CEGUI::QuadSplitMode)" (?addQuad@OpenGLRenderer@CEGUI@@UAEXABVRect@2@MPBVTexture@2@0ABVColourRect@2@W4QuadSplitMode@2@@Z)
OpenGLControl.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall CEGUI::EventSet::fireEvent(class CEGUI::String const &,class CEGUI::EventArgs &,class CEGUI::String const &)" (?fireEvent@EventSet@CEGUI@@UAEXABVString@2@AAVEventArgs@2@0@Z)
OpenGLControl.obj : error LNK2001: unresolved external symbol "public: virtual class CEGUI::RefCounted __thiscall CEGUI::EventSet::subscribeScriptedEvent(class CEGUI::String const &,class CEGUI::String const &)" (?subscribeScriptedEvent@EventSet@CEGUI@@UAE?AV?$RefCounted@VBoundSlot@CEGUI@@@2@ABVString@2@0@Z)
OpenGLControl.obj : error LNK2001: unresolved external symbol "public: virtual class CEGUI::RefCounted __thiscall CEGUI::EventSet::subscribeScriptedEvent(class CEGUI::String const &,unsigned int,class CEGUI::String const &)" (?subscribeScriptedEvent@EventSet@CEGUI@@UAE?AV?$RefCounted@VBoundSlot@CEGUI@@@2@ABVString@2@I0@Z)
OpenGLControl.obj : error LNK2001: unresolved external symbol "public: virtual class CEGUI::RefCounted __thiscall CEGUI::EventSet::subscribeEvent(class CEGUI::String const &,class CEGUI::SubscriberSlot)" (?subscribeEvent@EventSet@CEGUI@@UAE?AV?$RefCounted@VBoundSlot@CEGUI@@@2@ABVString@2@VSubscriberSlot@2@@Z)
OpenGLControl.obj : error LNK2001: unresolved external symbol "public: virtual class CEGUI::RefCounted __thiscall CEGUI::EventSet::subscribeEvent(class CEGUI::String const &,unsigned int,class CEGUI::SubscriberSlot)" (?subscribeEvent@EventSet@CEGUI@@UAE?AV?$RefCounted@VBoundSlot@CEGUI@@@2@ABVString@2@IVSubscriberSlot@2@@Z)
OpenGLControl.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall CEGUI::String::~String(void)" (__imp_??1String@CEGUI@@QAE@XZ) referenced in function "public: void __thiscall COpenGLControl::Create(class CRect,class CWnd *)" (?Create@COpenGLControl@@QAEXVCRect@@PAVCWnd@@@Z)
OpenGLControl.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall CEGUI::System::System(class CEGUI::Renderer *,class CEGUI::ResourceProvider *,class CEGUI::XMLParser *,class CEGUI::ScriptModule *,class CEGUI::String const &,class CEGUI::String const &)" (__imp_??0System@CEGUI@@QAE@PAVRenderer@1@PAVResourceProvider@1@PAVXMLParser@1@PAVScriptModule@1@ABVString@1@4@Z) referenced in function "public: void __thiscall COpenGLControl::Create(class CRect,class CWnd *)" (?Create@COpenGLControl@@QAEXVCRect@@PAVCWnd@@@Z)
OpenGLControl.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall CEGUI::String::String(char const *)" (__imp_??0String@CEGUI@@QAE@PBD@Z) referenced in function "public: void __thiscall COpenGLControl::Create(class CRect,class CWnd *)" (?Create@COpenGLControl@@QAEXVCRect@@PAVCWnd@@@Z)
OpenGLControl.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall CEGUI::OpenGLRenderer::OpenGLRenderer(unsigned int,class CEGUI::ImageCodec *)" (__imp_??0OpenGLRenderer@CEGUI@@QAE@IPAVImageCodec@1@@Z) referenced in function "public: void __thiscall COpenGLControl::Create(class CRect,class CWnd *)" (?Create@COpenGLControl@@QAEXVCRect@@PAVCWnd@@@Z)
OpenGLControl.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall CEGUI::OpenGLRenderer::~OpenGLRenderer(void)" (__imp_??1OpenGLRenderer@CEGUI@@UAE@XZ) referenced in function "public: virtual void * __thiscall CEGUI::OpenGLRenderer::`scalar deleting destructor'(unsigned int)" (??_GOpenGLRenderer@CEGUI@@UAEPAXI@Z)
OpenGLControl.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall CEGUI::System::~System(void)" (__imp_??1System@CEGUI@@UAE@XZ) referenced in function "public: virtual void * __thiscall CEGUI::System::`scalar deleting destructor'(unsigned int)" (??_GSystem@CEGUI@@UAEPAXI@Z)
OpenGLControl.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall CEGUI::System::renderGUI(void)" (__imp_?renderGUI@System@CEGUI@@QAEXXZ) referenced in function "protected: void __thiscall COpenGLControl::OnPaint(void)" (?OnPaint@COpenGLControl@@IAEXXZ)
OpenGLControl.obj : 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 "protected: void __thiscall COpenGLControl::OnPaint(void)" (?OnPaint@COpenGLControl@@IAEXXZ)


So what am I missing?

User avatar
gring
Not too shy to talk
Not too shy to talk
Posts: 21
Joined: Tue Mar 18, 2008 09:26
Location: Sweden

Re: Compiling problem - what am I missing?

Postby gring » Mon May 18, 2009 05:08

The renderers of OGRE has nothing to do with CEGUI (DirectX, openGL). CEGUI needs a renderer that uses OGRE primitives, OGRE is shipped with one called OgreCEGUIRenderer.
Default it is under samples/common/CEGUIRenderer under your OGRE source installation. Link that into your project.

Hope this gets you going into the right direction.

/Gring

50p
Just popping in
Just popping in
Posts: 13
Joined: Mon May 18, 2009 00:50

Re: Compiling problem - what am I missing?

Postby 50p » Mon May 18, 2009 09:14

Who told you I'm using OGRE? I didn't even mention about it in my previous post LOL. I said I'm using native OpenGL and MFC (google it if you don't know what it is -_-) and visit the link I posted to a tutorial I followed. Don't try to help if you don't know how to, please.

BTW, I have added all CEGUI directories to the IDE (yes, Libraries too). Maybe I should use .dlls instead? If so, which one I need? Are CEGUIBase.dll and OpenGLRenderer.dll enough?

EDIT:
I started messing about dependencies and I just forgot to add the .libs to the project but when I compiled and tried to run I was told I'm missing CEGUIBase.dll or CEGUIBase_d.dll so I copied one at a time (I can't add them as Reference because VS2003 gives me an error saying it can't add them ¬¬. Now, I have an exception and in the debug (output) window I have these 3 lines:
LDR: LdrpWalkImportDescriptor() failed to probe <path-to-my-project>\Debug\CEGUIBase_d.dll for its manifest, ntstatus 0xc0150002
Debugger:: An unhandled non-continuable exception was thrown during process load
The program '[3204] OpenGLDialog.exe: Native' has exited with code -1072365566 (0xc0150002).

This is shown when I try to run it in Debug mode.

Here I get same exceptions which are:
First-chance exception at 0x7c812a5b in OpenGLDialog.exe: Microsoft C++ exception: CEGUI::GenericException @ 0x0013ee8c.
Unhandled exception at 0x7c812a5b in OpenGLDialog.exe: Microsoft C++ exception: CEGUI::GenericException @ 0x0013ee8c.
Unhandled exception at 0x100765be in OpenGLDialog.exe: User breakpoint.
Unhandled exception at 0x100765bf in OpenGLDialog.exe: User breakpoint.
First-chance exception at 0x100765c9 in OpenGLDialog.exe: 0xC0000005: Access violation writing location 0x00000000.
Unhandled exception at 0x100765c9 in OpenGLDialog.exe: 0xC0000005: Access violation writing location 0x00000000.
First-chance exception at 0x100765c9 in OpenGLDialog.exe: 0xC0000005: Access violation writing location 0x00000000.
Unhandled exception at 0x100765c9 in OpenGLDialog.exe: 0xC0000005: Access violation writing location 0x00000000.
First-chance exception at 0x100765c9 in OpenGLDialog.exe: 0xC0000005: Access violation writing location 0x00000000.
Unhandled exception at 0x100765c9 in OpenGLDialog.exe: 0xC0000005: Access violation writing location 0x00000000.
First-chance exception at 0x100765c9 in OpenGLDialog.exe: 0xC0000005: Access violation writing location 0x00000000.
Unhandled exception at 0x100765c9 in OpenGLDialog.exe: 0xC0000005: Access violation writing location 0x00000000.
First-chance exception at 0x100765c9 in OpenGLDialog.exe: 0xC0000005: Access violation writing location 0x00000000.
Unhandled exception at 0x100765c9 in OpenGLDialog.exe: 0xC0000005: Access violation writing location 0x00000000.
The thread 'Win32 Thread' (0x1068) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x10cc) has exited with code -1073741819 (0xc0000005).
The thread 'Win32 Thread' (0x1120) has exited with code -1073741819 (0xc0000005).
The program '[4188] OpenGLDialog.exe: Native' has exited with code -1073741819 (0xc0000005).

They repeat because I pressed "Continue" on the exception window couple of times and eventually pressed "Break".
The unhandled exceptions about "User breakpoint", were referring to CEGUIBase.dll (I noticed that in the Call Stack window). Does it mean there is a breakpoint in .dll and basically can't use it? I wonder why it didn't compile the .libs and made the dlls for me.. If I could add the .dlls as reference to the project I wouldn't have to use the .lib would I?
Last edited by 50p on Mon May 18, 2009 11:54, edited 2 times in total.

User avatar
scriptkid
Home away from home
Home away from home
Posts: 1178
Joined: Wed Jan 12, 2005 12:06
Location: The Hague, The Netherlands
Contact:

Re: Compiling problem - what am I missing?

Postby scriptkid » Mon May 18, 2009 10:56

Hi,

To me it just looks like you are not linking to any cegui libs, are you? You need at least 'ceguibase.lib' and 'ceguiopenglrenderer.lib'.

HTH.
Check out my released snake game using Cegui!

50p
Just popping in
Just popping in
Posts: 13
Joined: Mon May 18, 2009 00:50

Re: Compiling problem - what am I missing?

Postby 50p » Mon May 18, 2009 11:50

Yeah that was the problem but I solved it and was editing the previous post to say about it when you posted. Now, I have that exceptions problem.

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

Re: Compiling problem - what am I missing?

Postby Jamarr » Mon May 18, 2009 19:35

It sounds like you are mixing up your debug and release configurations and files. I say this because part of your post talks about using "CEGUIBase.dll" and another about "CEGUIBase_d.dll". You need to make sure that if you are using a debug configuration, you should only be linking against the "_d" libraries. And for release you should only be linking against the CEGUI files without "_d".

I cannot tell if you are just mixing configurations/errors in your post, or if that is your actual problem. Either way, you should try to get your project compiling in a single configuration first; preferably in a debug build.

Also, I am assuming that you are trying to use the pre-compiled binary download (and not building CEGUI yourself)? If so, the libs you are using do not contain any actual object code because these .lib files are only used to link against the .dll during compiling/linking; the DLL is where the code actually lies, the .lib just tell your code how to load and access the dll. So you need to have the .dll files in the applications start-up directory or somewhere the system can find them (the system folder, the system path, etc.). If you do not use the .lib files, you would have to use something along the lines of LoadLibrary()+GetProcAddress() on windows to manually load the dll and locate handles to the functions you need from the dll; I seriously doubt you want to do this with such a large library.
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!

50p
Just popping in
Just popping in
Posts: 13
Joined: Mon May 18, 2009 00:50

Re: Compiling problem - what am I missing?

Postby 50p » Tue May 19, 2009 12:31

Well, I downloaded 0.6.2 binaries for VS2005 (the SDK?) and tried to use these. I told you about swapping the .dll because I was trying different build modes. First I tried to use _d.dll (debug) and I always had exception errors... so I took the .dll (release) and tried to build the app in release build but I got the same exceptions. I have absolutely no idea why! Than I had a reply to my post on GameDev.net that I should try Win32 and native OpenGL. I listened the guy and tried this tutorial: http://bobobobo.wordpress.com/2008/02/1 ... p-no-glut/ (I was given the link by the same guy) and I got a window with a triangle rotating on the screen, so I thought it was time to add CEGUI to it. When I read your post, I downloaded CEGUI 0.6.2 source code and tried to add all .h and .cpp file to my project but than I have over 600 warning messages and over 130 error messages, saying basically the same thing. These are just 2 examples:
CEGUI-0.6.2\src\CEGUIWindowManager.cpp(49) : error C2491: 'CEGUI::WindowManager::d_defaultResourceGroup' : definition of dllimport static data member not allowed
CEGUI-0.6.2\src\CEGUIWindow.cpp(89) : warning C4273: 'd_mousePassThroughEnabledProperty' : inconsistent dll linkage

What is wrong with dll linkage? I don't use .dll I use source... Does CEGUI need some dlls that I don't know of?

I had an error "no such file...." with <GL\glew.h> from "openglrenderer.h". So does CEGUI uses GLEW? I'll have to get GLEW and GLUT, even though I won't use GLUT but GLEW will, right? I must be confusing things -_-

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

Re: Compiling problem - what am I missing?

Postby CrazyEddie » Tue May 19, 2009 13:21

Posting a debug callstack of the point where the GenericException occurred might have been useful. Chances are though that it can't find the either the XML parser module of ImageCodec module DLLs.

I wouldn't recommend adding all the CEGUI source files so that they are part of your application's project - that's definitely not the way to use a library.

So does CEGUI uses GLEW?

The OpenGLRenderer module uses GLEW, not the core CEGUI.

I'll have to get GLEW and GLUT, even though I won't use GLUT but GLEW will, right?

The CEGUI source contains an embedded copy of GLEW that gets compiled in. And no, GLEW does not use GLUT. GLEW is the GL extension wrangler that aids in detecting and using OpenGL features and extentsions; GLUT is the GL utility toolkit which is intended for fast creation of example and prototype applications using OpenGL. The two libraries are totally separate and unrelated (aside from the GL bit).

CE.

50p
Just popping in
Just popping in
Posts: 13
Joined: Mon May 18, 2009 00:50

Re: Compiling problem - what am I missing?

Postby 50p » Tue May 19, 2009 13:44

I'm not sure if this is what you want because when the exception pops up and I press "Break" the arrow in callstack points to kernel32.dll but the message says:
Unhandled exception at 0x7c812a5b in OpenGLDialog.exe: Microsoft C++ exception: CEGUI::GenericException at memory location 0x0013eee4..

and the Show Disassembly goes to:
7C812A5B pop esi

But when I press "Continue" instead of "Break" and than when the next window pops up (with message: "OpenGLDialog.exe has triggered a breakpoint") I press "Break" and the arrow points to CEGUIBase.dll:
100765BE int 3

When I press "Continue" twice exception window say the same as above (triggered breakpoint) but points to one bit further that is:
100765BF int 3

And again, if I'll Continue the next window say: "Unhandled exception at 0x100765c9 in OpenGLDialog.exe: 0xC0000005: Access violation writing location 0x00000000." and points to (also CEGUIBase.dll):
100765C9 mov dword ptr [esi],eax

Than I can press Continue as many times as I want the same message will pop up pointing to the same location.


CrazyEddie wrote:I wouldn't recommend adding all the CEGUI source files so that they are part of your application's project - that's definitely not the way to use a library.

So, how do I use it than? How do you compile the lib with your project if not adding its source?

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

Re: Compiling problem - what am I missing?

Postby Jamarr » Tue May 19, 2009 17:00

What CE is asking for is not the text from the Output Window, eg the exception message, but for the text from the Call Stack Window. The call-stack basically shows the backtrace of function calls; this gives you contextual information about how the code got to the current location. It looks something like this:

Code: Select all

kernel32.dll!7c812afb()
[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]
kernel32.dll!7c812afb()
xxx.dll!_CxxThrowException(void * pExceptionObject=0x0012d718, const _s__ThrowInfo * pThrowInfo=0x0d60cee4)  Line 161
>xxx.dll!xxx::CEManager::_InitDisplay()  Line 563 + 0x63 bytes
xxx.dll!xxx::CEManager::_XPCInitDisplay(int inPhase=20, int inIsBefore=0, void * inRefcon=0x0d700308)  Line 591


In regards to using a library, you generally only link to the .lib files in your project; you do not typically include the libraries source files in your own project unless it is a small library, which CEGUI obviously is not. If you have the source files, then you generally compile/build the library under a separate project; then, as described previously, you link the generated .lib files into your own project.
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!

50p
Just popping in
Just popping in
Posts: 13
Joined: Mon May 18, 2009 00:50

Re: Compiling problem - what am I missing?

Postby 50p » Tue May 19, 2009 18:47

In the callstack it doesn't point to any function -_-' It just points to a cell in memory (I think), which is the fist number shown in the Disassembly, just like you've shown:
kernel32.dll!7c812afb()

But it points to CEGUIBase.dll like so:
CEGUIBase.dll!7C812A5B()

Note the number after "....dll!" It's the number pointing to some memory, which is the same as here:
7C812A5B pop esi

I thought you know what I'm talking about but it seems I'm too new to all this or just miss the word for all these "things". Anyway, it DOES NOT point to any function like in one of your examples:
xxx.dll!_CxxThrowException(void * pExceptionObject=0x0012d718, const _s__ThrowInfo * pThrowInfo=0x0d60cee4) Line 161

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

Re: Compiling problem - what am I missing?

Postby Jamarr » Wed May 20, 2009 14:59

That is because you are looking at a call-stack from a build without debug information, eg a release-build. You really should avoid trying to debug an application in release if at all possible. Try compiling/running with a debug build and when the exception is thrown the call-stack should contain the symbolic information.
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!

50p
Just popping in
Just popping in
Posts: 13
Joined: Mon May 18, 2009 00:50

Re: Compiling problem - what am I missing?

Postby 50p » Wed May 20, 2009 17:24

This is the time when a programmer wants to take the monitor and throw it through the window!

1. Tell me how do you include the CEGUI lib in your projects, please. I just want to make sure I'm doing everything correctly.
2. When I compile a debug build the .exe complains about .dll not _d.dll!
3. I copied _d.dll to the .exe folder (debug folder) and tried to rebuild the app... when it started the error came up saying it needs .dll (IN DEBUG MODE!)

4. When you guys answer my question 1, I'll probably by sure that it's something wrong with CEGUI or my program.

To stop myself from adding/removing the required code to use CEGUI I used a #define _USE_CEGUI 1 and #ifdef _USE_CEGUI. So, I can commend "#define _USE_CEGUI 1" line and the program will compile without the CEGUI and without errors.

I think I'll use the SDK (already compiled .dlls) since it'd be easier than compiling the CEGUI source myself in separate project (in which I have no clue what files to include -_-).

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

Re: Compiling problem - what am I missing?

Postby CrazyEddie » Wed May 20, 2009 19:43

While compiling CEGUI is as simple as pushing a button, if you're intending using the unmodified code then using the precompiled packages will be fine.

Generally you use the thing like you would any other SDK; add the main directory[1] and the include directory to the header search path locations for your project, add the lib dir to the linker library search path locations for your project (you seem to have this part right already).

To link your project you add the necessary libs to your project. The most important thing here, that you appear to have wrong at the moment, is that for the debug build you must link with the debug versions of the libs which have the _d suffix - so CEGUIBase_d.lib and so on. For the release build you link with the non suffixed versions - CEGUIBase.lib and so on.

The you just need to make sure that the various DLLs are in the path when the app runs.

CE.

[1] Ok, this is a little unusual, but it's due to the way we had things broken down into modular subsets. For those interested, future releases will correctly have everything under the include subdir.

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

Re: Compiling problem - what am I missing?

Postby Jamarr » Wed May 20, 2009 22:03

50p wrote:1. Tell me how do you include the CEGUI lib in your projects, please. I just want to make sure I'm doing everything correctly.

I am not trying to sound rude but I can only say this bluntly. This really is not the place to learn how to use the compiler you have chosen; there is plenty of information already out there so that you can teach yourself these things. That being said, there are already a lot of these threads on this forum so you should be able to find help or at least a starting point by searching.

2. When I compile a debug build the .exe complains about .dll not _d.dll!

Like I said in my first reply, and as CE touched on above, this is a clear indication that you are not linking the correct libs in your debug configuration. In a debug configuration, you should be using the "_d.lib" files as has been mentioned several times in this thread as well as in many other related threads on this forum.

3. I copied _d.dll to the .exe folder (debug folder) and tried to rebuild the app... when it started the error came up saying it needs .dll (IN DEBUG MODE!)

See #2. The .lib file you link against determines which .dll file you need.

4. When you guys answer my question 1, I'll probably by sure that it's something wrong with CEGUI or my program.

I would guess upwards of 90% of issues on this forum are user error. And if something this serious was wrong with CEGUI, do you really think you would be the only one complaining? I am guessing that you are just not linking against the right .lib files in your build configurations, and that you are also probably missing some. I think once you get your build configurations squared away your issues will disappear.
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!


Return to “Help”

Who is online

Users browsing this forum: Bing [Bot] and 8 guests