MSVC++ 2009, Win32, Unexplained Crashing/Errors

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

tylerp9p
Just popping in
Just popping in
Posts: 15
Joined: Tue Aug 25, 2009 22:18

Re: MSVC++ 2009, Win32, Unexplained Crashing/Errors

Postby tylerp9p » Thu Aug 27, 2009 19:48

The project was started as an Empty Project, I have not customised any other project configuration settings other than the _DEBUG_ and _RELEASE_ defines that I use internally, seperate from the _DEBUG and _RELEASE defines for my math library.

I am using the latest 6.2b SDK on the downloads page, and have compiled statically and dynamically from the source, with the same errors.

No CEGUI related project defines are set outside of the CEGUILibrary.h header file that I posted. The latest revision of it is:

Code: Select all

/******************************************
Game: Jeklynn Heights
Author: Tyler H
This source file is part of Jeklynn Heights
Copyright (C) 2009 - Vex Studios
******************************************/

#define CEGUI_STATIC
//#define TOLUA_STATIC
#define STATIC

// ==================================================
// LIBRARIES
// ==================================================

// Non-Static
#pragma comment( lib, "opengl32.lib" )      // OpenGL
#pragma comment( lib, "glu32.lib" )         // OpenGL Utilities
#pragma comment( lib, "winmm.lib" )         // Windows Multimedia API

// CEGUI Dependancies

#ifdef _DEBUG_

   //#pragma comment( lib, "corona_d.lib" )
   #pragma comment( lib, "pcre_d.lib" )
   #pragma comment( lib, "expat_d.lib" )         // CEGUIExpatParser_Static
   //#pragma comment( lib, "FreeImage_d.lib" )      // CEGUIFreeImageImageCodec_Static
   #pragma comment( lib, "freetype_d.lib" )
   #pragma comment( lib, "SILLY_d.lib" )         // CEGUISILLYImageCodec_Static

#else

   //#pragma comment( lib, "corona.lib" )
   #pragma comment( lib, "pcre.lib" )
   #pragma comment( lib, "expat.lib" )         // CEGUIExpatParser_Static
   //#pragma comment( lib, "FreeImage.lib" )      // CEGUIFreeImageImageCodec_Static
   #pragma comment( lib, "freetype.lib" )
   #pragma comment( lib, "freeglut.lib" )
   #pragma comment( lib, "SILLY.lib" )         // CEGUISILLYImageCodec_Static
   //#pragma comment( lib, "DevIL.lib" )
   //#pragma comment( lib, "ILU.lib" )
   //#pragma comment( lib, "ILUT.lib" )
   //#pragma comment( lib, "xerces-c_2.lib" )

#endif

#ifdef _DEBUG_

   #ifdef STATIC

      #pragma comment( lib, "CEGUIBase_Static_d.lib" )
      //#pragma comment( lib, "CEGUICoronaImageCodec_Static_d.lib" )
      //#pragma comment( lib, "CEGUIDevILImageCodec_Static_d.lib" )
      #pragma comment( lib, "CEGUIExpatParser_Static_d.lib" )
      #pragma comment( lib, "CEGUIFalagardWRBase_Static_d.lib" )
      //#pragma comment( lib, "CEGUIFreeImageImageCodec_Static_d.lib" )
      #pragma comment( lib, "CEGUISILLYImageCodec_Static_d.lib")
      //#pragma comment( lib, "CEGUITGAImageCodec_Static_d.lib" )
      //#pragma comment( lib, "CEGUITinyXMLParser_Static_d.lib" )
      //#pragma comment( lib, "CEGUIXercesParser_Static_d.lib" )
     #pragma comment( lib, "OpenGLGUIRenderer_Static_d.lib" )


   #else

      //#pragma comment( lib, "CEGUIBase_d.lib" )
      //#pragma comment( lib, "CEGUICoronaImageCodec_d.lib" )
      //#pragma comment( lib, "CEGUIDevILImageCodec_d.lib" )
      //#pragma comment( lib, "CEGUIExpatParser_d.lib" )
      //#pragma comment( lib, "CEGUIFalagardWRBase_d.lib" )
      //#pragma comment( lib, "CEGUIFreeImageImageCodec_d.lib" )
      //#pragma comment( lib, "CEGUISILLYImageCodec_d.lib")
      //#pragma comment( lib, "CEGUITGAImageCodec_d.lib" )
      //#pragma comment( lib, "CEGUITinyXMLParser_d.lib" )
      //#pragma comment( lib, "CEGUIXercesParser_d.lib" )
      //#pragma comment( lib, "OpenGLGUIRenderer_d.lib" )

   #endif

#else

   #ifdef STATIC

      #pragma comment( lib, "CEGUIBase_Static.lib" )
      //#pragma comment( lib, "CEGUICoronaImageCodec_Static.lib" )
      //#pragma comment( lib, "CEGUIDevILImageCodec_Static.lib" )
      #pragma comment( lib, "CEGUIExpatParser_Static.lib" )
      #pragma comment( lib, "CEGUIFalagardWRBase_Static.lib" )
      //#pragma comment( lib, "CEGUIFreeImageImageCodec_Static.lib" )
      #pragma comment( lib, "CEGUISILLYImageCodec_Static.lib")
      //#pragma comment( lib, "CEGUITGAImageCodec_Static.lib" )
      //#pragma comment( lib, "CEGUITinyXMLParser_Static.lib" )
      //#pragma comment( lib, "CEGUIXercesParser_Static.lib" )
      #pragma comment( lib, "OpenGLGUIRenderer_Static.lib" )

   #else

      //#pragma comment( lib, "CEGUIBase.lib" )
      //#pragma comment( lib, "CEGUICoronaImageCodec.lib" )
      //#pragma comment( lib, "CEGUIDevILImageCodec.lib" )
      //#pragma comment( lib, "CEGUIExpatParser.lib" )
      //#pragma comment( lib, "CEGUIFalagardWRBase.lib" )
      //#pragma comment( lib, "CEGUIFreeImageImageCodec.lib" )
      //#pragma comment( lib, "CEGUISILLYImageCodec.lib")
      //#pragma comment( lib, "CEGUITGAImageCodec.lib" )
      //#pragma comment( lib, "CEGUITinyXMLParser.lib" )
      //#pragma comment( lib, "CEGUIXercesParser.lib" )
      //#pragma comment( lib, "OpenGLGUIRenderer.lib" )

   #endif

#endif

// ==================================================
// INCLUDES
// ==================================================

#pragma warning( push )

   #pragma warning( disable: 4251 )

   // Windows
   #include <windows.h>
   #include <math.h>
   #include <time.h>

   // CEGUI
   #include "CEGUI.h"
   #include "..\RendererModules\OpenGLGUIRenderer\OpenGLRenderer.h"
   #include "..\ImageCodecModules\SILLYImageCodec\CEGUISILLYImageCodecModule.h"
   #include "CEGUIDefaultResourceProvider.h"

#pragma warning( pop )

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

Re: MSVC++ 2009, Win32, Unexplained Crashing/Errors

Postby CrazyEddie » Fri Aug 28, 2009 08:54

I can't explain this; it sounds like you basically did what I did in my own test. I started with an empty project, added a c++ file into which I pasted your code and added some setup stuff, I added a copy of your previous header that you posted, I set the include and library paths in the project to include the 0.6.2b SDK locations, built it and ran it (this was a debug static build, btw).

Would it be possible to post the .vcproj project file text here (or send it to me), because right at the moment I do not have any ideas or suggestions for you.

CE

tylerp9p
Just popping in
Just popping in
Posts: 15
Joined: Tue Aug 25, 2009 22:18

Re: MSVC++ 2009, Win32, Unexplained Crashing/Errors

Postby tylerp9p » Fri Aug 28, 2009 10:20

Here you are:

Code: Select all

<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
   ProjectType="Visual C++"
   Version="9.00"
   Name="Jeklynn Heights"
   ProjectGUID="{4CDCECFB-92EA-415A-AC0F-3F9A57AA16C0}"
   RootNamespace="JeklynnHeights"
   TargetFrameworkVersion="131072"
   >
   <Platforms>
      <Platform
         Name="Win32"
      />
   </Platforms>
   <ToolFiles>
   </ToolFiles>
   <Configurations>
      <Configuration
         Name="Debug|Win32"
         OutputDirectory="$(SolutionDir)$(ConfigurationName)"
         IntermediateDirectory="$(ConfigurationName)"
         ConfigurationType="1"
         CharacterSet="1"
         >
         <Tool
            Name="VCPreBuildEventTool"
         />
         <Tool
            Name="VCCustomBuildTool"
         />
         <Tool
            Name="VCXMLDataGeneratorTool"
         />
         <Tool
            Name="VCWebServiceProxyGeneratorTool"
         />
         <Tool
            Name="VCMIDLTool"
         />
         <Tool
            Name="VCCLCompilerTool"
            Optimization="0"
            AdditionalIncludeDirectories="../../../Engine/include;D:\CEGUI\include;D:\CEGUI\dependencies\include"
            PreprocessorDefinitions="_DEBUG_"
            MinimalRebuild="true"
            BasicRuntimeChecks="3"
            RuntimeLibrary="3"
            WarningLevel="3"
            DebugInformationFormat="4"
         />
         <Tool
            Name="VCManagedResourceCompilerTool"
         />
         <Tool
            Name="VCResourceCompilerTool"
         />
         <Tool
            Name="VCPreLinkEventTool"
         />
         <Tool
            Name="VCLinkerTool"
            AdditionalLibraryDirectories="D:\CEGUI\lib;D:\CEGUI\dependencies\lib"
            GenerateDebugInformation="true"
            TargetMachine="1"
         />
         <Tool
            Name="VCALinkTool"
         />
         <Tool
            Name="VCManifestTool"
         />
         <Tool
            Name="VCXDCMakeTool"
         />
         <Tool
            Name="VCBscMakeTool"
         />
         <Tool
            Name="VCFxCopTool"
         />
         <Tool
            Name="VCAppVerifierTool"
         />
         <Tool
            Name="VCPostBuildEventTool"
         />
      </Configuration>
      <Configuration
         Name="Release|Win32"
         OutputDirectory="..\..\..\Bin"
         IntermediateDirectory="$(ConfigurationName)"
         ConfigurationType="1"
         CharacterSet="2"
         WholeProgramOptimization="1"
         >
         <Tool
            Name="VCPreBuildEventTool"
         />
         <Tool
            Name="VCCustomBuildTool"
         />
         <Tool
            Name="VCXMLDataGeneratorTool"
         />
         <Tool
            Name="VCWebServiceProxyGeneratorTool"
         />
         <Tool
            Name="VCMIDLTool"
         />
         <Tool
            Name="VCCLCompilerTool"
            Optimization="2"
            EnableIntrinsicFunctions="true"
            AdditionalIncludeDirectories="../../../Engine/include;D:\CEGUI\include;D:\CEGUI\dependencies\include;D:\CEGUI\RendererModules\OpenGLGUIRenderer\GLEW"
            PreprocessorDefinitions="_RELEASE_;_CRT_SECURE_NO_DEPRECATE;HAVE_CONFIG_H;CEGUIBASE_EXPORTS;PCRE_STATIC;OPENGL_GUIRENDERER_EXPORTS;GLEW_STATIC;CEGUISILLYIMAGECODEC_EXPORTS"
            RuntimeLibrary="2"
            EnableFunctionLevelLinking="true"
            WarningLevel="3"
            DebugInformationFormat="3"
         />
         <Tool
            Name="VCManagedResourceCompilerTool"
         />
         <Tool
            Name="VCResourceCompilerTool"
         />
         <Tool
            Name="VCPreLinkEventTool"
         />
         <Tool
            Name="VCLinkerTool"
            AdditionalLibraryDirectories="D:\CEGUI\dependencies\lib;D:\CEGUI\lib"
            IgnoreDefaultLibraryNames=""
            AddModuleNamesToAssembly=""
            GenerateDebugInformation="true"
            OptimizeReferences="2"
            EnableCOMDATFolding="2"
            TargetMachine="1"
         />
         <Tool
            Name="VCALinkTool"
         />
         <Tool
            Name="VCManifestTool"
            EmbedManifest="false"
         />
         <Tool
            Name="VCXDCMakeTool"
         />
         <Tool
            Name="VCBscMakeTool"
         />
         <Tool
            Name="VCFxCopTool"
         />
         <Tool
            Name="VCAppVerifierTool"
         />
         <Tool
            Name="VCPostBuildEventTool"
         />
      </Configuration>
   </Configurations>
   <References>
   </References>
   <Files>
      <Filter
         Name="Source Files"
         Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
         UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
         >
         <File
            RelativePath=".\CDayNightCycle.cpp"
            >
         </File>
         <File
            RelativePath=".\CGame.cpp"
            >
         </File>
         <File
            RelativePath=".\CGameTimer.cpp"
            >
         </File>
         <File
            RelativePath=".\CLevelManager.cpp"
            >
         </File>
         <File
            RelativePath=".\Main.cpp"
            >
         </File>
         <Filter
            Name="Core"
            >
         </Filter>
         <Filter
            Name="Leadwerks"
            >
            <File
               RelativePath="..\..\..\Engine\include\gamelib.cpp"
               >
            </File>
         </Filter>
         <Filter
            Name="UI"
            >
            <File
               RelativePath=".\CUIManager.cpp"
               >
            </File>
         </Filter>
      </Filter>
      <Filter
         Name="Header Files"
         Filter="h;hpp;hxx;hm;inl;inc;xsd"
         UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
         >
         <File
            RelativePath=".\CConfig.h"
            >
         </File>
         <File
            RelativePath=".\CDayNightCycle.h"
            >
         </File>
         <File
            RelativePath=".\CGame.h"
            >
         </File>
         <File
            RelativePath=".\CGameTimer.h"
            >
         </File>
         <File
            RelativePath=".\CLevelManager.h"
            >
         </File>
         <File
            RelativePath=".\CTime.h"
            >
         </File>
         <Filter
            Name="Core"
            >
            <File
               RelativePath=".\Game.h"
               >
            </File>
            <File
               RelativePath=".\Platform.h"
               >
            </File>
            <File
               RelativePath=".\Singleton.h"
               >
            </File>
            <File
               RelativePath=".\SingletonHandler.h"
               >
            </File>
         </Filter>
         <Filter
            Name="Leadwerks"
            >
            <File
               RelativePath="..\..\..\Engine\include\engine.h"
               >
            </File>
            <File
               RelativePath="..\..\..\Engine\include\framewerk.h"
               >
            </File>
            <File
               RelativePath="..\..\..\Engine\include\gamelib.h"
               >
            </File>
            <File
               RelativePath="..\..\..\Engine\include\layer.h"
               >
            </File>
            <File
               RelativePath="..\..\..\Engine\include\renderer.h"
               >
            </File>
         </Filter>
         <Filter
            Name="UI"
            >
            <File
               RelativePath=".\CEGUILibrary.h"
               >
            </File>
            <File
               RelativePath=".\CUIManager.h"
               >
            </File>
         </Filter>
      </Filter>
      <Filter
         Name="Resource Files"
         Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
         UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
         >
      </Filter>
   </Files>
   <Globals>
   </Globals>
</VisualStudioProject>


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

Re: MSVC++ 2009, Win32, Unexplained Crashing/Errors

Postby CrazyEddie » Fri Aug 28, 2009 10:51

Hi, thanks :)

The only thing that's wrong in there is the definition of these macros:

Code: Select all

CEGUIBASE_EXPORTS
OPENGL_GUIRENDERER_EXPORTS
CEGUISILLYIMAGECODEC_EXPORTS


You only define those when actually building the CEGUI code itself. I'm not actually sure if this is even related to the issue (especially for static links), but it's one more thing to eliminate.

CE.

tylerp9p
Just popping in
Just popping in
Posts: 15
Joined: Tue Aug 25, 2009 22:18

Re: MSVC++ 2009, Win32, Unexplained Crashing/Errors

Postby tylerp9p » Fri Aug 28, 2009 20:58

I feel like an idiot because you are right, it is indeed the loading the TGA file that is the cause.

I was just now thinking to verify that, and by removing the TGA file from the imageset, the program no longer crashed.

Now just to figure out how to resolve THAT problem.

tylerp9p
Just popping in
Just popping in
Posts: 15
Joined: Tue Aug 25, 2009 22:18

Re: MSVC++ 2009, Win32, Unexplained Crashing/Errors

Postby tylerp9p » Fri Aug 28, 2009 21:20

Here is the cause of the problem:

glPixelStoref(0x806E, 0); // GL_UNPACK_IMAGE_HEIGHT
glPixelStoref(GL_PACK_ROW_LENGTH, 0);
glPixelStoref(GL_UNPACK_ROW_LENGTH, 0);


I had those lines commented out, where as they were needed to get CEGUI working with Leadwerks. Thank you for your help, and I am sorry for what I consider a large waste of your time. Look forward to screenshots, etc. in the future.

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

Re: MSVC++ 2009, Win32, Unexplained Crashing/Errors

Postby CrazyEddie » Sun Aug 30, 2009 08:49

I'm glad you found the issue; thanks for posting the resolution - it's actually quite interesting :)

CE.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 4 guests