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

Re: Compiling problem - what am I missing?

Postby 50p » Thu May 21, 2009 00:55

From what CE said, I wasn't doing anything wrong. The only thing I did wrong was that I linked to the wrong lib in the debug mode. I change the links and now it uses _d.dlls. But when I try to run the app I get an Application Error with message:
The application failed to initialize properly (0xc0150002). Click OK to terminate the application.

(the address is same every time I try to run the app)
- I must be missing some .libs than, right?
- Which are required just to render a Window?
- I only linked to CEGUIBase_d.lib and OpenGLGUIRenderer_d.lib... any more?
- What is CEGUIBase_Static.lib for?

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 » Thu May 21, 2009 08:56

I must say that - having read back over some of the posts here - I'm actually now slightly confused.

First you said:
50p wrote:I can't add them as Reference because VS2003 gives me an error saying it can't add them

So we might assume you're using MSVC++ 7.1.

But then you said this:
50p wrote:I downloaded 0.6.2 binaries for VS2005

:?:

This is why people should always post a summary of their set up is in their original post.

So I think the key question now is which compiler are you actually using? If you're using MSVC++ 7.1 (that's the 2003 one), then you need to download the SDK for that compiler and not the SDK for MSVC++ 8 (which is the 2005 version). If you are in fact using MSVC++ 2005, then to use the precompiled SDK you must ensure that you have service pack 1 for MSVC++ 2005 applied or you will see errors such as those that you are now getting.

Jamarr wrote:I would guess upwards of 90% of issues on this forum are user error.

I would follow this up by saying that of those 90%, probably 75% (or more) are some of the most basic system / compiler / project configuration errors - which, to be honest, I find really, really shocking.

Now to go off on a tangent, slightly. This is not aimed at this thread or 50p in particular, but rather the whole 'internet generation' of programmers. When I was a boy, I had no access to things like the internet, had nobody who could be considered a mentor, and no books other than a couple you could sometimes get at the library; if I had issues it was either a case of solving those issue for myself or not progressing. Since not progressing was not an option to me, I basically had to work through those issues - by myself - until I had them fixed. While I do not begrudge people the wonders of the modern age(!), I think it would do some so called 'programmers' a good turn to actually have to think for themselves once in a while - it's what makes boy programmers in to men programmers :lol:

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 » Thu May 21, 2009 13:08

Yes, I've changed to VS2005 so I downloaded the binaries for VS2k5. If I didn't have SP1 would the code compile at all? What has got SP1 to do with running the application? If the user of my application didn't have VS2k5 SP1 he wouldn't be able to run it? That's ridiculous. I'm not sure if I run SP1 so I'll download it now.

CrazyEddie wrote:...
When I was a boy, I had no access to things like the internet, had nobody who could be considered a mentor, and no books other than a couple you could sometimes get at the library; if I had issues it was either a case of solving those issue for myself or not progressing. Since not progressing was not an option to me, I basically had to work through those issues - by myself - until I had them fixed. While I do not begrudge people the wonders of the modern age(!), I think it would do some so called 'programmers' a good turn to actually have to think for themselves once in a while - it's what makes boy programmers in to men programmers :lol:

CE.

If you didn't have access to internet you didn't use any 3rd party libs -_- When I get a problem with compiling MY OWN code I try to fix it myself before I post on any forums and it doesn't take me 5 mins of trying... sometimes it's a matter of few days. I'm sure that my problem is so stupidly easy to fix that even very beginning programmer could fix it...

BTW, I'm not a "boy", I just started later than you :P

EDIT:
Just checked in "Help -> About...", and it just says Microsoft Visual Studio 2005, so I'm guessing it's not SP1...

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 » Thu May 21, 2009 13:34

50p wrote:Yes, I've changed to VS2005 so I downloaded the binaries for VS2k5. If I didn't have SP1 would the code compile at all? What has got SP1 to do with running the application? If the user of my application didn't have VS2k5 SP1 he wouldn't be able to run it? That's ridiculous. I'm not sure if I run SP1 so I'll download it now.

Yes it would compile, and no it would not run. Yes, it is ridiculous - complain to those heathens at Microsoft, it's their mess.

[Edit]Minor qualification here with regards to it not running, whether the user has Visual Studio or not is irrelevant; it has to do with mismatched runtimes[/Edit]

50p wrote:If you didn't have access to internet you didn't use any 3rd party libs -_-

OMG! How naive are you? You actually think that pre-internet there was no way to obtain access to 3rd party libraries and other such things? I'm truly embarrassed for you. :mrgreen:

50p wrote:BTW, I'm not a "boy", I just started later than you :P

I did not say you were a boy. I said "when I was a boy" :lol:

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 » Thu May 21, 2009 14:50

CrazyEddie wrote:
50p wrote:If you didn't have access to internet you didn't use any 3rd party libs -_-

OMG! How naive are you? You actually think that pre-internet there was no way to obtain access to 3rd party libraries and other such things? I'm truly embarrassed for you. :mrgreen:
CE.

LOL

Anyway, I installed SP1 and tried rebuilt the app. Again, unhandled exception:
Unhandled exception at 0x7c812a5b in OpenGLAndWin32.exe: Microsoft C++ exception: CEGUI::RendererException at memory location 0x0013f5b8..

I pressed "Break" to see the callstack and here's what I saw:
http://img34.imageshack.us/img34/4539/exception.png
(Also, I see a green arrow in my file pointing to: g.myRenderer = new CEGUI::OpenGLRenderer( 0 ); )
( g <- is my Global struct which includes CEGUI::OpenGLRenderer *myRenderer; )

When I pressed "Continue" on the previous window (instead of Break) next unhandled exception window pops up with this message:
Unhandled exception at 0x00000000 in OpenGLAndWin32.exe: 0xC0000005: Access violation reading location 0x00000000.

Here, when I press "Break" to see the callstack, here's the callstack:
http://img35.imageshack.us/img35/2216/exception2.png
(Also, I see a green arrow in my file pointing to: CEGUI::System::getSingleton().renderGUI(); )

And as before, I can press Continue as many times I want but it will come up with the same unhandled exception as the one above.

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 » Thu May 21, 2009 20:49

Well it seems we are at least making some progress here. The OpenGLRenderer expects you to have already setup/initialized OpenGL, and will throw an exception if you have not done so.

Have you tried looking at your CEGUI.log since your recent changes? Typically exception information from CEGUI will be written in your log file. Also, you may want to place try/catch blocks around your CEGUI code so that such exceptions can be caught and handled appropriately (like displaying the exception message).

Since this issue seems to seem from initializing CEGUI, it may be helpful to post your CEGUI initialization and any related code.

p.s. you don't need to bother posting the information after hitting "continue" as this will only add extra, superfluous information possibly masking the real issue.
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 » Thu May 21, 2009 21:43

OK, just checked the CEGUI.log and nothing seem to fail at all... Here is the content:
21/05/2009 22:36:39 (Std) +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
21/05/2009 22:36:39 (Std) + Crazy Eddie's GUI System - Event log +
21/05/2009 22:36:39 (Std) + (http://www.cegui.org.uk/) +
21/05/2009 22:36:39 (Std) +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

21/05/2009 22:36:39 (Std) CEGUI::Logger singleton created. (014A6A90)
21/05/2009 22:36:39 (Std) ---- Begining CEGUI System initialisation ----
21/05/2009 22:36:39 (Std) CEGUI::ImagesetManager singleton created (01481670)
21/05/2009 22:36:39 (Std) CEGUI::FontManager singleton created. (014816C8)
21/05/2009 22:36:39 (Std) CEGUI::WindowFactoryManager singleton created
21/05/2009 22:36:39 (Std) CEGUI::WindowManager singleton created (014A7338)
21/05/2009 22:36:39 (Std) CEGUI::SchemeManager singleton created. (014A79A8)
21/05/2009 22:36:39 (Std) CEGUI::MouseCursor singleton created. (014A7AE8)
21/05/2009 22:36:39 (Std) CEGUI::GlobalEventSet singleton created. (014A7C68)
21/05/2009 22:36:39 (Std) CEGUI::WidgetLookManager singleton created. (014A7DB8)
21/05/2009 22:36:39 (Std) CEGUI::WindowRendererManager singleton created (014A8030)
21/05/2009 22:36:39 (Std) WindowFactory for 'DefaultWindow' windows added. (105FF5E8)
21/05/2009 22:36:39 (Std) WindowFactory for 'DragContainer' windows added. (105FF9A8)
21/05/2009 22:36:39 (Std) WindowFactory for 'ScrolledContainer' windows added. (105FF0D0)
21/05/2009 22:36:39 (Std) WindowFactory for 'ClippedContainer' windows added. (105FF868)
21/05/2009 22:36:39 (Std) WindowFactory for 'CEGUI/Checkbox' windows added. (105FF4A8)
21/05/2009 22:36:39 (Std) WindowFactory for 'CEGUI/PushButton' windows added. (105FFC28)
21/05/2009 22:36:39 (Std) WindowFactory for 'CEGUI/RadioButton' windows added. (105FFCC8)
21/05/2009 22:36:39 (Std) WindowFactory for 'CEGUI/Combobox' windows added. (105FEF88)
21/05/2009 22:36:39 (Std) WindowFactory for 'CEGUI/ComboDropList' windows added. (105FFE08)
21/05/2009 22:36:39 (Std) WindowFactory for 'CEGUI/Editbox' windows added. (105FEE48)
21/05/2009 22:36:39 (Std) WindowFactory for 'CEGUI/FrameWindow' windows added. (105FF2C8)
21/05/2009 22:36:39 (Std) WindowFactory for 'CEGUI/ItemEntry' windows added. (105FF548)
21/05/2009 22:36:39 (Std) WindowFactory for 'CEGUI/Listbox' windows added. (105FFD68)
21/05/2009 22:36:39 (Std) WindowFactory for 'CEGUI/ListHeader' windows added. (105FFF48)
21/05/2009 22:36:39 (Std) WindowFactory for 'CEGUI/ListHeaderSegment' windows added. (105FF028)
21/05/2009 22:36:39 (Std) WindowFactory for 'CEGUI/Menubar' windows added. (105FFEA8)
21/05/2009 22:36:39 (Std) WindowFactory for 'CEGUI/PopupMenu' windows added. (105FF368)
21/05/2009 22:36:39 (Std) WindowFactory for 'CEGUI/MenuItem' windows added. (105FEB20)
21/05/2009 22:36:39 (Std) WindowFactory for 'CEGUI/MultiColumnList' windows added. (105FF228)
21/05/2009 22:36:39 (Std) WindowFactory for 'CEGUI/MultiLineEditbox' windows added. (105FFB88)
21/05/2009 22:36:39 (Std) WindowFactory for 'CEGUI/ProgressBar' windows added. (105FF728)
21/05/2009 22:36:39 (Std) WindowFactory for 'CEGUI/ScrollablePane' windows added. (105FF908)
21/05/2009 22:36:39 (Std) WindowFactory for 'CEGUI/Scrollbar' windows added. (105FEEE8)
21/05/2009 22:36:39 (Std) WindowFactory for 'CEGUI/Slider' windows added. (105FF7C8)
21/05/2009 22:36:39 (Std) WindowFactory for 'CEGUI/Spinner' windows added. (105FF408)
21/05/2009 22:36:39 (Std) WindowFactory for 'CEGUI/TabButton' windows added. (105FFAE8)
21/05/2009 22:36:39 (Std) WindowFactory for 'CEGUI/TabControl' windows added. (105FF188)
21/05/2009 22:36:39 (Std) WindowFactory for 'CEGUI/Thumb' windows added. (105FED00)
21/05/2009 22:36:39 (Std) WindowFactory for 'CEGUI/Titlebar' windows added. (105FEC60)
21/05/2009 22:36:39 (Std) WindowFactory for 'CEGUI/Tooltip' windows added. (105FEBC0)
21/05/2009 22:36:39 (Std) WindowFactory for 'CEGUI/ItemListbox' windows added. (105FFA48)
21/05/2009 22:36:39 (Std) WindowFactory for 'CEGUI/GroupBox' windows added. (105FEDA8)
21/05/2009 22:36:39 (Std) WindowFactory for 'CEGUI/Tree' windows added. (105FF688)
21/05/2009 22:36:39 (Std) Window type alias named 'DefaultGUISheet' added for window type 'DefaultWindow'.
21/05/2009 22:36:39 (Std) CEGUI::System singleton created. (014A50B8)
21/05/2009 22:36:39 (Std) ---- CEGUI System initialisation completed ----
21/05/2009 22:36:39 (Std) ---- Version 0.6.2 ----
21/05/2009 22:36:39 (Std) ---- Renderer module is: CEGUI::OpenGLRenderer - Official OpenGL based renderer module for CEGUI ----
21/05/2009 22:36:39 (Std) ---- XML Parser module is: CEGUI::ExpatParser - Official expat based parser module for CEGUI ----
21/05/2009 22:36:39 (Std) ---- Scripting module is: None ----


Hope this will help some of you and point me into right direction. I'll try add try/catch to get exception's message.

EDIT:
I don't seem to know how to handle RendererException o.O
Here's some code:

Code: Select all

   #ifdef _USE_CEGUI
   try{
      g.myRenderer = new CEGUI::OpenGLRenderer( 0 );
      new CEGUI::System( g.myRenderer );
   }
   catch( CEGUI::RendererException e )
   {
      CEGUI::Logger::logEvent( e.getMessage() );
      //MessageBox( NULL, (LPCWSTR)e.getMessage( ).c_str(), L"Failure", NULL );
   }
   #endif

If I use the MessageBox line, than I see a message which contails squares only...
Image

With the Logger, I get an error:
....\main.cpp(124) : error C2352: 'CEGUI::Logger::logEvent' : illegal call of non-static member function

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 » Fri May 22, 2009 08:33

I believe the only place a RendererException is raised in the 0.6.x code from instantiating the OpenGL renderer module is if it can't initialise GLEW - so that goes back to what Jamarr said about ensuring there is a valid GL context for the process.

The compile issue with 'CEGUI::Logger::logEvent' is because that's not a static function.

The issue with the message not showing in the message box version is because CEGUI::String::c_str returns a c-style string pointer (i.e. pointer to const char) as opposed to a pointer to a 'wide' string - so you'll probably have to transcode the string to something more non-standard so that Windows can understand ;)

HTH

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 » Fri May 22, 2009 11:14

So how did you want me to log the event's message? I checked the ::Logger on the API Ref. page and found .d_message which is not accessible and .logEvent() which is not static function that is, I can't use it. I have no idea how to convert that C string pointer to Win32 based string that can be used in MessageBox.

BTW, I re-added the GLEW to my project and there is no difference. I get a VC++ Runtime Library error which looks like this:
Image
The path shown in the box points to nowhere because I don't have "projects" directory on my D drive.

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 » Fri May 22, 2009 14:29

As I said in my last reply, and as CE also mentioned:
The OpenGLRenderer expects you to have already setup/initialized OpenGL, and will throw an exception if you have not done so.


Have you setup your OpenGL context before initializing CEGUI?
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 » Fri May 22, 2009 17:19

I must have missed that sentence! OMG. That helped. I managed to run the application without any exceptions nor error message boxes.
The tutorial 1 on the wiki should say about it because I tried to initialize the system after I created the window. I could have gone around that problem earlier.

Anyway, Thanks a lot. Finally I can start messing about CEGUI and you have 1 user less to help :D


Return to “Help”

Who is online

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