Hi. I'm trying to upgrade my project to CEGUI 0.6 and running into some problems.
First, I tried downloading the SDK for MSVC++ 8, but I kept getting a run-time "The application failed to initialize properly" error even when I'd put all the .dlls in my working directory.
So then I tried downloading the source and building myself. I edited the lua makefile config to build OpenGL, expat parser, and the samples. I copied over the dependencies folder from the SDK package and built debug_static. It gave a bunch of linker errors on the sample programs.
If I tried to input the static libraries into my project anyway (ignoring the failed sample programs), I get tons of linker warnings about "locally defined symbols" and undefined external symbol errors. I also get compiler warnings about "warning C4251: 'CEGUI::TreeItem::d_listItems' : class 'std::vector<_Ty>' needs to have dll-interface to be used by clients of class 'CEGUI::TreeItem'"
So then I tried the dlls instead of the statics libs... I was able to build them and then build my project fine; but when I try to run it, I get the "The application failed to initialize properly" error again.
I'd rather use the statics than the .dlls, but if I could get either working, that'd be good. Any help?
Edit: And another rider question... I keep seeing good wiki articles linked to like this one. But when I navigate to the articles section in the wiki, I only see 2. How do I find all these other articles?
Edit Edit: Um... am I allowed to ask a third question? How do you change what image codec CEGUI uses to load images? It seems to be using the TGA codec by default which seems to dislike my 8-bit .png files. (I could not get it to load an 8-bit tga either and had to make it 24, which seems wasteful.)
Problems upgrading to CEGUI 0.6
Moderators: CEGUI MVP, CEGUI Team
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Hi,
What were the linker errors you were getting - such information is surprisingly useful when trying to diagnose issues
You can safely ignore the C4251 warnings.
For static builds, please ensure you have defined CEGUI_STATIC in the preprocessor definitions for your project.
Not sure why the dynamically linked version fails to start, posting the text of the project file may be useful (just the compiler and linker config parts if you like).
The good wiki stuff can be found in Tutorials and Code Snippets. We are (slowly) updating and cleaning up the wiki content, so please bear with us on that one
For changing the image codec, you can change the default in the config.lua file, or you can specify another one at runtime (dll builds only) by using the OpenGLRenderer::setImageCodec member and passing in the name of the codec to use, without the CEGUI prefix (so for examle, "DevILImageCodec" to use the CEGUIDevILImageCodec.dll module):
HTH
CE.
What were the linker errors you were getting - such information is surprisingly useful when trying to diagnose issues
You can safely ignore the C4251 warnings.
For static builds, please ensure you have defined CEGUI_STATIC in the preprocessor definitions for your project.
Not sure why the dynamically linked version fails to start, posting the text of the project file may be useful (just the compiler and linker config parts if you like).
The good wiki stuff can be found in Tutorials and Code Snippets. We are (slowly) updating and cleaning up the wiki content, so please bear with us on that one
For changing the image codec, you can change the default in the config.lua file, or you can specify another one at runtime (dll builds only) by using the OpenGLRenderer::setImageCodec member and passing in the name of the codec to use, without the CEGUI prefix (so for examle, "DevILImageCodec" to use the CEGUIDevILImageCodec.dll module):
Code: Select all
using namespace CEGUI;
Renderer* r = System::getSingleton().getRenderer();
static_cast<OpenGLRenderer*>(r)->setImageCodec( "DevILImageCodec" );
...
HTH
CE.
- scriptkid
- Home away from home
- Posts: 1178
- Joined: Wed Jan 12, 2005 12:06
- Location: The Hague, The Netherlands
- Contact:
I'll check at home how my config.lua looks which we used to build SDKs from. I doubt that i used the tga-only codec, but you'll never know
Check out my released snake game using Cegui!
Well, defining CEGUI_STATIC made it go from 16 errors and 61 warnings to 14 errors and 0 warnings. That seems like progress. Anyway, here are the errors. I'm sorry for not giving the full errors last time, but I didn't want to post more than necessary. Anyway...
I'll go back to my working 0.5 configuration and check changing the image codec. Thanks again.
Edit: Here's the stuff from the dll-based project file you asked for:
The following files from the 0.6 build are in my executable /debug directory: CEGUIBase_d.dll, CEGUICoronaImageCodec_d.dll, CEGUIDevILImageCodec_d.dll, CEGUIExpatParser_d.dll, CEGUIFalagardWRBase_d.dll, CEGUIFreeImageImageCodec_d.dll, CEGUILua_d.dll, CEGUISILLYImageCodec_d.dll, CEGUITGAImageCodec_d.dll, OpenGLGUIRenderer_d.dll, tolua++_d.dll
Edit Edit: According to [url="http://www.dependencywalker.com/"]Dependency Walker[/url], it was missing the file "dwmapi.dll" I downloaded a copy [url="http://www.dll-files.com/dllindex/dll-files.shtml?dwmapi"]here[/url], and placed it in the executable directory, but it still fails to to run with the same error message ("The application failed to initialize properly (0x0150002). Click OK to terminate the application."). Any idea what dwmapi.dll has to do with CEGUI? Could there be multiple versions of that file?
I'm using MSVC++ 2005 Express if that matters.
Code: Select all
1>CEGUIBase_Static_d.lib(CEGUIEditbox.obj) : error LNK2001: unresolved external symbol _pcre_free
1>CEGUIBase_Static_d.lib(CEGUIEditbox.obj) : error LNK2019: unresolved external symbol _pcre_compile referenced in function "public: void __thiscall CEGUI::Editbox::setValidationString(class CEGUI::String const &)" (?setValidationString@Editbox@CEGUI@@QAEXABVString@2@@Z)
1>CEGUIBase_Static_d.lib(CEGUIEditbox.obj) : error LNK2019: unresolved external symbol _pcre_exec referenced in function "protected: bool __thiscall CEGUI::Editbox::isStringValid(class CEGUI::String const &)const " (?isStringValid@Editbox@CEGUI@@IBE_NABVString@2@@Z)
1>CEGUIExpatParser_Static_d.lib(CEGUIExpatParser.obj) : error LNK2019: unresolved external symbol _XML_ParserFree referenced in function "public: virtual void __thiscall CEGUI::ExpatParser::parseXMLFile(class CEGUI::XMLHandler &,class CEGUI::String const &,class CEGUI::String const &,class CEGUI::String const &)" (?parseXMLFile@ExpatParser@CEGUI@@UAEXAAVXMLHandler@2@ABVString@2@11@Z)
1>CEGUIExpatParser_Static_d.lib(CEGUIExpatParser.obj) : error LNK2019: unresolved external symbol _XML_ErrorString referenced in function "public: virtual void __thiscall CEGUI::ExpatParser::parseXMLFile(class CEGUI::XMLHandler &,class CEGUI::String const &,class CEGUI::String const &,class CEGUI::String const &)" (?parseXMLFile@ExpatParser@CEGUI@@UAEXAAVXMLHandler@2@ABVString@2@11@Z)
1>CEGUIExpatParser_Static_d.lib(CEGUIExpatParser.obj) : error LNK2019: unresolved external symbol _XML_GetErrorCode referenced in function "public: virtual void __thiscall CEGUI::ExpatParser::parseXMLFile(class CEGUI::XMLHandler &,class CEGUI::String const &,class CEGUI::String const &,class CEGUI::String const &)" (?parseXMLFile@ExpatParser@CEGUI@@UAEXAAVXMLHandler@2@ABVString@2@11@Z)
1>CEGUIExpatParser_Static_d.lib(CEGUIExpatParser.obj) : error LNK2019: unresolved external symbol _XML_GetCurrentLineNumber referenced in function "public: virtual void __thiscall CEGUI::ExpatParser::parseXMLFile(class CEGUI::XMLHandler &,class CEGUI::String const &,class CEGUI::String const &,class CEGUI::String const &)" (?parseXMLFile@ExpatParser@CEGUI@@UAEXAAVXMLHandler@2@ABVString@2@11@Z)
1>CEGUIExpatParser_Static_d.lib(CEGUIExpatParser.obj) : error LNK2019: unresolved external symbol _XML_Parse referenced in function "public: virtual void __thiscall CEGUI::ExpatParser::parseXMLFile(class CEGUI::XMLHandler &,class CEGUI::String const &,class CEGUI::String const &,class CEGUI::String const &)" (?parseXMLFile@ExpatParser@CEGUI@@UAEXAAVXMLHandler@2@ABVString@2@11@Z)
1>CEGUIExpatParser_Static_d.lib(CEGUIExpatParser.obj) : error LNK2019: unresolved external symbol _XML_SetCharacterDataHandler referenced in function "public: virtual void __thiscall CEGUI::ExpatParser::parseXMLFile(class CEGUI::XMLHandler &,class CEGUI::String const &,class CEGUI::String const &,class CEGUI::String const &)" (?parseXMLFile@ExpatParser@CEGUI@@UAEXAAVXMLHandler@2@ABVString@2@11@Z)
1>CEGUIExpatParser_Static_d.lib(CEGUIExpatParser.obj) : error LNK2019: unresolved external symbol _XML_SetElementHandler referenced in function "public: virtual void __thiscall CEGUI::ExpatParser::parseXMLFile(class CEGUI::XMLHandler &,class CEGUI::String const &,class CEGUI::String const &,class CEGUI::String const &)" (?parseXMLFile@ExpatParser@CEGUI@@UAEXAAVXMLHandler@2@ABVString@2@11@Z)
1>CEGUIExpatParser_Static_d.lib(CEGUIExpatParser.obj) : error LNK2019: unresolved external symbol _XML_SetUserData referenced in function "public: virtual void __thiscall CEGUI::ExpatParser::parseXMLFile(class CEGUI::XMLHandler &,class CEGUI::String const &,class CEGUI::String const &,class CEGUI::String const &)" (?parseXMLFile@ExpatParser@CEGUI@@UAEXAAVXMLHandler@2@ABVString@2@11@Z)
1>CEGUIExpatParser_Static_d.lib(CEGUIExpatParser.obj) : error LNK2019: unresolved external symbol _XML_ParserCreate referenced in function "public: virtual void __thiscall CEGUI::ExpatParser::parseXMLFile(class CEGUI::XMLHandler &,class CEGUI::String const &,class CEGUI::String const &,class CEGUI::String const &)" (?parseXMLFile@ExpatParser@CEGUI@@UAEXAAVXMLHandler@2@ABVString@2@11@Z)
1>OpenGLGUIRenderer_Static_d.lib(openglrenderer.obj) : error LNK2019: unresolved external symbol _gluOrtho2D@32 referenced in function "private: void __thiscall CEGUI::OpenGLRenderer::initPerFrameStates(void)" (?initPerFrameStates@OpenGLRenderer@CEGUI@@AAEXXZ)
I'll go back to my working 0.5 configuration and check changing the image codec. Thanks again.
Edit: Here's the stuff from the dll-based project file you asked for:
Code: Select all
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""D:\Unnamed RPG\Engines\Enlightenment\3rd Party\CEGUI-0.6.0\include";"D:\Unnamed RPG\Engines\Enlightenment\3rd Party\CEGUI-0.6.0";"D:\Unnamed RPG\Engines\Enlightenment\Map Editor\Source\System\Include";"D:\Unnamed RPG\Engines\Enlightenment\Map Editor\Source\GUI\Include";"D:\Unnamed RPG\Engines\Enlightenment\Enlightenment\3rd Party\SFML- 1.2.573\include";"D:\Unnamed RPG\Engines\Enlightenment\Enlightenment\Source\System\Include";"D:\Unnamed RPG\Engines\Enlightenment\Enlightenment\Source\ObjectManagers\Include";"D:\Unnamed RPG\Engines\Enlightenment\Enlightenment\Source\GUI\Include";"D:\Unnamed RPG\Engines\Enlightenment\Enlightenment\Source\Graphics\Include";"D:\Unnamed RPG\Engines\Enlightenment\Enlightenment\Source\GameLogic\Include""
PreprocessorDefinitions="WIN32;_DEBUG;MAP_EDITOR;SHOW_WARNINGS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="User32.Lib Gdi32.lib sfml-system-s-d.lib sfml-window-s-d.lib sfml-graphics-s-d.lib CEGUIBase_d.lib CEGUIExpatParser_d.lib CEGUIFalagardWRBase_d.lib CEGUILua_d.lib CEGUITGAImageCodec_d.lib CEGUISILLYImageCodec_d.lib OpenGLGUIRenderer_d.lib tolua++_d.lib"
LinkIncremental="2"
AdditionalLibraryDirectories=""D:\Unnamed RPG\Engines\Enlightenment\3rd Party\CEGUI-0.6.0\bin";"D:\Unnamed RPG\Engines\Enlightenment\3rd Party\CEGUI-0.6.0\lib";"D:\Unnamed RPG\Engines\Enlightenment\Enlightenment\3rd Party\SFML- 1.2.573\lib\vc2005""
GenerateDebugInformation="true"
SubSystem="2"
TargetMachine="1"
/>
The following files from the 0.6 build are in my executable /debug directory: CEGUIBase_d.dll, CEGUICoronaImageCodec_d.dll, CEGUIDevILImageCodec_d.dll, CEGUIExpatParser_d.dll, CEGUIFalagardWRBase_d.dll, CEGUIFreeImageImageCodec_d.dll, CEGUILua_d.dll, CEGUISILLYImageCodec_d.dll, CEGUITGAImageCodec_d.dll, OpenGLGUIRenderer_d.dll, tolua++_d.dll
Edit Edit: According to [url="http://www.dependencywalker.com/"]Dependency Walker[/url], it was missing the file "dwmapi.dll" I downloaded a copy [url="http://www.dll-files.com/dllindex/dll-files.shtml?dwmapi"]here[/url], and placed it in the executable directory, but it still fails to to run with the same error message ("The application failed to initialize properly (0x0150002). Click OK to terminate the application."). Any idea what dwmapi.dll has to do with CEGUI? Could there be multiple versions of that file?
I'm using MSVC++ 2005 Express if that matters.
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Hi,
I have done some browsing The "failed to initialize" error is *highly* likely to be that you're using a non SP-1 release of the MSVC++ 2005. You should download and apply the appropriate SP1 for MSVC++ 2005 to resolve that issue.
The link errors in static builds are missing libs (wow!). Basically, you need to include some of the dependency libs - for pcre and expat, and also the glu32.lib (I think that's what it's called on Windows).
The dwmapi.dll is a Windows Vista thing. As far as i can tell it's not important if it's missing.
CE.
I have done some browsing The "failed to initialize" error is *highly* likely to be that you're using a non SP-1 release of the MSVC++ 2005. You should download and apply the appropriate SP1 for MSVC++ 2005 to resolve that issue.
The link errors in static builds are missing libs (wow!). Basically, you need to include some of the dependency libs - for pcre and expat, and also the glu32.lib (I think that's what it's called on Windows).
The dwmapi.dll is a Windows Vista thing. As far as i can tell it's not important if it's missing.
CE.
Who is online
Users browsing this forum: No registered users and 17 guests