1、Building CEGUISince the Ogre 1.7 version, CEGUI is not an Ogre dependency anymore using its own basic interface for its samplesCookbook Snippets GUI Snippets CEGUI Snippets Building CEGUITable of contents General Step-by-step guide QuestionsGeneralSince the Ogre 1.7 version, CEGUI is not an Ogre dep
2、endency anymore using its own basic interface for its samples now instead of CEGUI.This means that from now on, you have to build CEGUI for your Ogre project yourself, in case you want to use the latest Ogre or CEGUI versions. Otherwise, you can grab the latest precompiled dependencies from the Ogre
3、 download section and the CEGUI download section .Be careful: The current 04/14/10 precompiled Win32 Ogre (1.7.0) and CEGUI (0.7.1) releases are not compatible. Either compile Ogre or CEGUI yourself to solve this problem.The recommended approach however is to build CEGUI against the Ogre version you
4、 want to use.Here are all the links you will need: For the source code its recommended to get the latest stable branch from SVN (link leads to CEGUI 0.7 version which is the latest version right now). You can also just download it packed from hereNote: If the branch versions source code seems to be
5、unstable or not working at all, you can try the latest stable snapshot which will most definitely be stable and working. Additionallyto the source code you will need dependencies suiting your compiler . Download them for your CEGUI version and unpack the “dependencies“ folder into your CEGUI main fo
6、lder, so that it will co-exist next to the folders “bin“, “cegui“,“datafiles“ etc. Otherwise, if you find the info here unsufficient, you might wanna check this link on how to obtain libray source for CEGUI in the CEGUI wiki. Or you can just use the source code from any release package, which you ca
7、n find in the CEGUI download section (link above).Step-by-step guide Get the appropriate CEGUI version from the CEGUI download page or get the very latest CEGUI version from the SVN repository (see links and info above). Get the latest Ogre version. If you are compiling it yourself, you will need to
8、 build it first to get Ogres .lib and .dll files ready for CEGUI. In your CEGUI folder there should be a folder called “projects“ with a subfolder called “premake“. It is recommended to use the custom premake version of CEGUI . Otherwise you can get version 3.6 or 3.7 of premake. Once you have prema
9、ke extract the premake.exe file into the said folder.Open config.lua in the premake folder and edit the Ogre and OIS paths accordingly, so that they will point to the dependency files. In my case for example the 2 lines look like this (having the OGRE and CEGUI main folders on the same level):OGRE_P
10、ATHS = “/OGRE“, “include/OGRE“, “lib“ OIS_PATHS = “/OGRE“, “include/OIS“, “lib“ Note:Remember to use forward slashes here! Just copying the paths from the Windows explorer will give you backward slashes. Replace them!Next, set all Renderers you do not need to “false“, in this case we will only need
11、OGRE_RENDERER. You can also set all samples to false, except maybe SAMPLES_OGRE if you want to compile those.Important:Since Ogre 1.7 the “boost“ library is a new dependency of OGRE. If you are unsure if your Ogre version needs boost, you might want to check if there is a boost folder in your Ogre m
12、ain folder. In case your Ogre version makes use of boost, you will additionally add boost to the extra paths of CEGUIOgreRenderer, in my case it looks like this:CEGUI_EXTRA_PATHS = “/OGRE/boost_1_42“, “, “lib“, “CEGUIOgreRenderer“ Note:Make sure the path to your boost folder uses the version number
13、that matches your setup! Next, we create our Visual Studio Projects - Execute build_vs2008.bat to create a Visual Studio 2008 project or execute any other .bat file for your respective compiler version. (The next step will also explain how to proceed with other compilers.) This should create CEGUI.s
14、ln in the premake folder; open it.Note:If you are working Visual Studio 2010, use it to open the generated 2008 project. You will be asked if you want to convert it to a 2010 project, which should work without producing any errors.Note:If youre using MinGW, you can try the experimental CEGUI version
15、; if that doesnt work (and youre using the Code:Blocks IDE), you might be able to import the Visual Studio solution (File Import project MS Visual Studio solution.). If you have the Ogre lib files separated into Debug and Release folders, you will have to change the path in the Linker settings of th
16、e project so they will point to the lib/Debug or lib/Release folder for each configuration respectively. Also, if you have the Ogre include files separated into OGRE and OIS folders, you will have to change the path in the C+ settings of the project so they will point to the include/OGRE Buildthe CE
17、GUIOgreRenderer in Debug and Release mode. You must also build the CEGUIBase, CEGUIExpatParser and CEGUIFalagardWRBase projects to get their .dlls. Now that you have built the .dll files and .lib files for CEGUI by yourself, you only have to change the linker settings of your project so that the nee
18、ded .lib files and their folder paths are included there. Also you might want to include the dlls into a folder where your executable application will find them (for example just the folder your executable starts from). Finally remember to set the CEGUI include directory (for example “CEGUIceguiincl
19、udecegui“) inside your C+ project settings.If everything worked out, you now have CEGUI up and running!QuestionsFor any suggestions and questions send a PM to me (Ident) or just ask in the forums and someone else will help you for sure.In case you need help building Ogre, Id recommend reading for example this short guide .Also you might want to check the CEGUI wiki version of this site in case you find the information here outdated.Alias: Building_CEGUI