------------------------------------------------------------------------------------------------------
- CELAYOUTEDITOR BUILD STEPS FOR VS2003-5 (V1.5c)
This small document details the steps needed to successfully build the latest TRUNK/HEAD version of CELayoutEditor against WXWidgets V2.8.* (source) and CEGUI latest SVN version, using VS2003 (7.1) or VS2005 (8.0) with SP1 in Windows XP SP2 and TortoiseSVN as the SVN client.
NOTE: For similar steps, but for the CEImagesetEditor, check http://www.cegui.org.uk/phpBB2/viewtopic.php?t=2780.
TODO: Add to wiki!
This guide was built and tested in both VS2003 (7.1) and VS2005 (8.0) only! However, it is more than likely that most steps (if not all) will be valid for other versions of Visual Studio (7.0, 6.0).
NOTE (06/11/07): Please note that Visual studio 6 is no longer officially supported!
This is my particular way of doing things and reflects my own experience with CELayoutEditor builds. Therefore, it might not be the most correct approach. I hope it might be helpful still, especially to newcomers.
IMPORTANT NOTE (22/10/07): Due to recent SVN trunk changes to CELayoutEditor, the CEGUI binaries and zipped source found in the CEGUI download area can no longer be used to compile CELayoutEditor. The reason is that the editor requires changes that are only available (at this time) in the CEGUI SVN trunk.
History:
- NOTE: Dates use the dd/mm/yy format.
- Version 1.5c - 10/12/07 - Added requirements section.
- Version 1.5b - 07/12/07 - Updated guide to wxWidgets 2.8.7.
- Version 1.5 - 06/11/07 - Guide now contemplates VS2003 as well. Added mention that Visual Studio 6 is no longer officially supported. Updated guide to wxWidgets 2.8.6. Added wxUSE_ABOUTDLG. Added splash screen. Some style modifications.
- Version 1.4 - 22/10/07 - Added note about different VS versions and a few others explaining that you'll need to use CEGUI SVN (and not the binaries or zipped source) to build the CELayoutEditor SVN version due to recent changes (thanks go to daviticus).
- Version 1.3c - 19/10/07 - Added recommendation about wxUSE_EXCEPTIONS.
- Version 1.3b - 11/10/07 - Added note that VC++8 solution is already in SVN. Fixed incorrect setup.h paths. Added reference to CEImagesetEditor equivalent steps. Fixed incorrect URLs.
- Version 1.3 - 09/10/07 - Corrected the SILLY DLL problem (thanks to dmail).
- Version 1.2 - 26/09/07 - Added option to build CEGUI from SVN.
- Version 1.1 - 15/09/07 - Added option to build CEGUI from source.
- Version 1.0 - 13/09/07 - Initial release.
0) REQUIREMENTS:
-----------------------
CELayoutEditor requires the use of some third party external libraries. These libraries are as follows:
- - Latest Crazy Eddie's GUI System SVN trunk (the editor doesn't compile with the last stable CEGUI release 0.5.0b as it requires more recent elements) (http://www.cegui.org.uk)
- wxWidgets (2.8.* or better) (http://www.wxwidgets.org)
1) INIT:
----------
1. Close all instances of Visual Studio
2) CEGUI DOWNLOAD & SETUP:
---------------------------------------
NOTE: As mentioned above, the latest CEGUI binaries or the zipped source (0.5.0b at the time of this writing) can no longer be used to build the latest CELayoutEditor SVN. They are still presented below for reference purposes.
We now need to get the latest CEGUI SVN trunk version.
Build CEGUI binaries (reference only)
-------------------------------------------
NOTE: Use 'Build CEGUI SVN' below to correctly build the CELayoutEditor SVN version.
2.1 Download CEGUI 0.5.0b binaries for VC++ 8 or VC++ 7.1 from http://www.cegui.org.uk/wiki/index.php/CEGUI_Downloads_0.5.0.
2.2 Install CEGUI in desired directory.
2.3 Create an environment variable $(CEGUI) that will store the previous dir.
- 2.3.1 Go to My Computer\Properties\Advanced\Environment Variables.
2.3.2 Press new in the user variables area.
2.3.3 Create a new variable named CEGUI and with the directory present in 2.2 as value (e.g. D:\Dev\CEGUI-SDK-0.5.0b-vc8).
------------------------------------------
NOTE: Use 'Build CEGUI SVN' below to correctly build the CELayoutEditor SVN version.
2.1 Download CEGUI 0.5.0b source from http://www.cegui.org.uk/wiki/index.php/CEGUI_Downloads_0.5.0.
2.2 Unpack previous zip to directory of your choice.
2.3 Create an environment variable $(CEGUI) that will store the previous dir.
- 2.3.1 Go to My Computer\Properties\Advanced\Environment Variables.
2.3.2 Press new in the user variables area.
2.3.3 Create a new variable named CEGUI and with the directory present in 2.2 as value (e.g. D:\Dev\CEGUI-0.5.0).
2.5 Unpack dependencies to $(CEGUI) directory.
2.6 Go to $(CEGUI)\makefiles\premake and run build_vs2005.bat or build_vs2003.bat (these batch files use premake to generate the VS2005 and VS2003 solution respectively).
2.7 Open the generated $(CEGUI)\makefiles\premake\CEGUI.sln.
2.8 Build the solution in both DEBUG and RELEASE configurations.
Build CEGUI source (SVN)
-----------------------------
NOTE: I'm using TortoiseSVN as my SVN client for illustration purposes, but you can use anything you like.
2.1 In Windows Explorer, pick a directory of your choice and create a directory named CEGUI-0.5.0-SVN or any other name of your choice.
2.2 Right click in the previous directory and choose the TortoiseSVN right-mouse menu option 'SVN Checkout...'.
2.3 We want the HEAD version here, so use https://crayzedsgui.svn.sourceforge.net/svnroot/crayzedsgui/cegui_mk2/trunk as the 'URL of repository'.
2.4 Choose 'Head revision' radio button and press OK.
2.5 Create an environment variable $(CEGUI) that will store the previous dir.
- 2.5.1 Go to My Computer\Properties\Advanced\Environment Variables.
2.5.2 Press new in the user variables area.
2.5.3 Create a new variable named CEGUI and with the directory present in 2.1 as value (e.g. D:\Dev\CEGUI-0.5.0-SVN).
2.7 Unpack dependencies to $(CEGUI) directory.
NOTE: Premake is not available in the SVN repository, so you'll need to download and install it
2.8 Go to http://premake.sourceforge.net/download.
2.9 Download the latest premake version for windows (at the time of this writing, premake-win32-3.4.zip).
2.10 Unpack premake.exe to $(CEGUI)\makefiles\premake or any directory in the system path.
2.11 Go to $(CEGUI)\makefiles\premake and run build_vs2005.bat or build_vs2003.bat (these batch files use premake to generate the VS2005 and VS2003 solution respectively).
2.12 Open the generated $(CEGUI)\makefiles\premake\CEGUI.sln.
2.13 Build the solution in both DEBUG and RELEASE configurations.
3) WXWIDGETS DOWNLOAD & SETUP:
----------------------------------------------
Time to retrieve the latest WxWidgets source version (2.8.7 at the time of this writing). This is a required dependency of CELayoutEditor and will need to be built later on.
NOTE: CELayoutEditor requires wxWidgets 2.8.* or higher. This guide has been tested with the following versions: 2.8.7, 2.8.6, 2.8.5.
3.1 Go to http://www.wxwidgets.org/downloads/ and dowload wxAll source archive for version 2.8.7.
3.2 Unpack the previous tar (wxWidgets-2.8.7.tar.tar) to a directory of your choice.
3.3 Create an environment variable $(WXWIDGETS) that will store the previous dir.
- 3.3.1 Go to My Computer\Properties\Advanced\Environment Variables.
3.3.2 Press new in the user variables area.
3.3.3 Create a new variable named WXWIDGETS and with the directory present in 3.2 as value (e.g. D:\Dev\wxWidgets-2.8.7).
---------------------------------------------------
Instead of downloading a source or binary version, we'll retrieve the latest CELayoutEditor version directly from the TRUNK/HEAD of SVN. I did this because I wanted to work with the latest patches, but you might choose to use a more stable version if you prefer.
NOTE: I'm using TortoiseSVN as my SVN client for illustration purposes, but you can use anything you like.
4.1 In Windows Explorer, pick a directory of your choice and create a directory named CELayoutEditor.
4.2 Right click in the previous directory and choose the TortoiseSVN right-mouse menu option SVN Checkout...'.
4.3 We want the HEAD version here, so use https://crayzedsgui.svn.sourceforge.net/svnroot/crayzedsgui/CELayoutEditor/trunk as the 'URL of repository'.
4.4 Choose 'Head revision' radio button and press OK.
4.5 Create an environment variable $(CE_LAYOUT_EDITOR) that will store the previous dir.
- 4.5.1 Go to My Computer\Properties\Advanced\Environment Variables.
4.5.2 Press new in the user variables area.
4.5.3 Create a new variable named CE_LAYOUT_EDITOR and with the directory present in 4.1 as value (e.g. D:\Dev\CELayoutEditor).
-------------------------------------------------
IMPORTANT NOTE: As of 10/10/07, the VC++8 (VS2005) solution is already present in SVN, configured with the correct environment variables mentioned in this section. On 05/11/07, the VC++7.1 (VS2003) suffered the same fate. You can now skip to section 6 directly. This section is kept for reference purposes.
Let's prepare the build process. You'll notice that no CELayoutEditor solution exists for VC++8 (only for 6 and 7). So, if using VS2005, go to 5.1. Otherwise, open $(CE_LAYOUT_EDITOR)\vc++7.1\CELayoutEditor.sln and go to 5.5:
5.1 Create a new directory named vc++8 in $(CE_LAYOUT_EDITOR)
5.2 Copy the contents of $(CE_LAYOUT_EDITOR)\vc++7.1 to $(CE_LAYOUT_EDITOR)\vc++8
5.3 Open $(CE_LAYOUT_EDITOR)\vc++8\CELayoutEditor.sln in VS2005.
5.4 When prompted, convert project to VC++8.
5.5 Right click the CELayoutEditor project in the Solution Explorer and choose properties.
5.6 Navigate to ConfigurationProperties\C/C++\General
5.7 Open the Additional Include Directories panel
5.8 Remove the following two lines - that refer to SVN relative paths where CEGUI is located and therefore not needed since our own paths will probably differ - in both Debug and Release configurations (top-left dropdown menu)
- - ..\..cegui_head
- ..\..\cegui_head\include
- - $(CEGUI)
- $(CEGUI)\include
- $(WXWIDGETS)\include
- $(WXWIDGETS)\include\msvc
5.11 Open the Additional Library Directories panel
5.12 Remove the following line, for the same reason as above in both Debug and Release configurations (top-left dropdown menu)
- - ..\..\cegui_head\lib
- - $(CEGUI)\lib
- $(WXWIDGETS)\lib\vc_lib
5.15 Replace the following lines (which refer to an older WxWidgets version)
- Debug Configuration
- wxmsw26ud_core.lib TO wxmsw28ud_core.lib
- wxbase26ud.lib TO wxbase28ud.lib
- wxmsw26ud_gl.lib TO wxmsw28ud_gl.lib
Release Configuration
- wxmsw26u_core.lib TO wxmsw28u_core.lib
- wxbase26u.lib TO wxbase28u.lib
- wxmsw26u_gl.lib TO wxmsw28u_gl.lib
-----------------------------------------------------------
Let's try to build our editor. We must first build WxWidgets, since it is a dependency.
6.1 Go to $(WXWIDGETS)\build\msw and open file wx.dsw in VS2005 or VS2003.
6.2 wx.dsw is a VC6 project, so it needs to be converted to VS2005 or VS2003. When prompted, accept the conversion by pressing the 'Yes To All' button.
6.3 Build the WX solution in 'Unicode Debug' and 'Unicode Release' configurations
- NOTE: This may take a while since the solution is quite big
NOTE2: The Wiki 'Getting Started' entry (http://www.cegui.org.uk/wiki/index.php/Getting_Started) mentions that no unicode is required, however the $(WXWIDGETS)\include\msvc\wx\setup.h references the WXWidgets unicode files
- - error C2504: 'wxGLCanvas' : base class undefined d:\dev\ceguitests\celayouteditor\inc\editorcanvas.h 30
7) CELAYOUTEDITOR SECOND BUILD ATTEMPT:
--------------------------------------------------------
Let's correct the previous problem and try again.
7.1 Open $(WXWIDGETS)\include\wx\msw\setup.h and replace
Code: Select all
#define wxUSE_GLCANVAS 0
Code: Select all
#define wxUSE_GLCANVAS 1
7.2 Open $(WXWIDGETS)\include\wx\univ\setup.h and replace
Code: Select all
#if defined(__WIN32__)
#define wxUSE_GLCANVAS 1
else
#define wxUSE_GLCANVAS 0
WITH
Code: Select all
#define wxUSE_GLCANVAS 1
7.3 While we're at it, also check in the previous two files, if the defines wxUSE_EXCEPTIONS and wxUSE_ABOUTDLG are set to 1 (this is the default, so it should be on). This is mandatory and CELayoutEditor will not compile without it.
Code: Select all
#define wxUSE_EXCEPTIONS 1
Code: Select all
#define wxUSE_ABOUTDLG 1
7.4 Rebuild the WX solution in 'Unicode Debug' and 'Unicode Release' configurations.
7.5 Rebuild CELayoutEditor solution. Hoperfully, the build will be successful.
8) RUNNING CELAYOUTEDITOR:
--------------------------------------
IMPORTANT NOTE: As of 05/11/07, the VC++7.1 (VS2003) and VC++8 (VS2005) solutions have post-build steps that take care of the problems enumerated in this section. You should now be able to run the editor without any further problems. This section is kept for reference purposes.
If you try to run the application, errors will popup because the required CEGUI dlls are not present in the executable directory. So, do the following:
8.1 Copy the following files from $(CEGUI)\bin to $(CE_LAYOUT_EDITOR)\bin\debug and/or $(CE_LAYOUT_EDITOR)\bin\release depending on the configuration you are testing
- TO $(CE_LAYOUT_EDITOR)\bin\debug (Debug configuration)
- CEGUIBase_d.dll
- CEGUIExpatParser_d.dll
- CEGUIFalagardWRBase_d.dll
- CEGUISILLYImageCodec_d.dll
- CEGUITGAImageCodec_d.dll
- OpenGLGUIRenderer_d.dll
TO $(CE_LAYOUT_EDITOR)\bin\release (Release configuration)
- CEGUIBase.dll
- CEGUIExpatParser.dll
- CEGUIFalagardWRBase.dll
- CEGUISILLYImageCodec.dll
- CEGUITGAImageCodec.dll
- OpenGLGUIRenderer.dll
- - CELayoutEditor:OnInit - Error: DynamicModule::DynamicModule - Failed to load module 'CEGUISILLYImageCodec_d': The specified module could not be found.
8.2 As it turns out, the error message is not correct. As dmail explained (see post below), the GL renderer will dynamically load the the CEGUI SILLY DLL which in turn will load the SILLY DLL. And here lies the problem, since the application cannot find the SILLY DLL in the path. Therefore, the error message should be (for debug builds):
- -CELayoutEditor:OnInit - Error: DynamicModule::DynamicModule - Failed to load module 'CEGUISILLYImageCodec_d': The specified SILLY_d module could not be found.
NOTE: You could also change the used image codec by opening EditorFrame.cpp in CELayoutEditor and replacing the following line
Code: Select all
CEGUI::OpenGLRenderer::setDefaultImageCodecName("SILLYImageCodec");
BY
Code: Select all
CEGUI::OpenGLRenderer::setDefaultImageCodecName("TGAImageCodec");
8.4 You'll notice one final error when running the editor: Missing splash screen. To solve it, copy $(CE_LAYOUT_EDITOR)\src\bitmaps\splash.png to $(CE_LAYOUT_EDITOR)\bin\debug or $(CE_LAYOUT_EDITOR)\bin\release depending on the configuration you're building the editor in.
8.5 Rebuild CELayoutEditor and run it. Everything seems OK now.
I hope you liked this little guide. Let me know what you think.