Difference between revisions of "How to install CEGUI 0.8.4 With MinGW"

From CEGUI Wiki - Crazy Eddie's GUI System (Open Source)
Jump to: navigation, search
m
m
Line 16: Line 16:
 
Then, you launch cmake-gui, click configure, select the MinGW Makefiles generator,<br>
 
Then, you launch cmake-gui, click configure, select the MinGW Makefiles generator,<br>
 
check all options except for CEGUI_BUILD_EFFECTS11 and CEGUI_GNUtoMS, configure again and generate.<br>
 
check all options except for CEGUI_BUILD_EFFECTS11 and CEGUI_GNUtoMS, configure again and generate.<br>
If Cmake works successfully, you can see the Makefile at the target binary directory you choose.<br>
+
If Cmake have worked successfully, you can see the Makefile at the target binary directory you choose.<br>
 
Build it.<br>
 
Build it.<br>
 
You could find built dependencies at <dependencies_binary_root>/dependencies.<br>
 
You could find built dependencies at <dependencies_binary_root>/dependencies.<br>
Line 41: Line 41:
 
For example, with the built-in MinGW dlltool,<br>
 
For example, with the built-in MinGW dlltool,<br>
 
1.Run dlltool --export-all-symbols libxerces-c_3.dll -z temp.txt<br>
 
1.Run dlltool --export-all-symbols libxerces-c_3.dll -z temp.txt<br>
2.At Line 6919, modify _ZN11xercesc_3_19XMLString7releaseEPPwPNS_13MemoryManagerE to _ZN11xercesc_3_19XMLString7releaseEPPtPNS_13MemoryManagerE = _ZN11xercesc_3_19XMLString7releaseEPPwPNS_13MemoryManagerE,<br>
+
2.Edit the temp.txt.<br>
 +
At Line 6919, modify _ZN11xercesc_3_19XMLString7releaseEPPwPNS_13MemoryManagerE to _ZN11xercesc_3_19XMLString7releaseEPPtPNS_13MemoryManagerE = _ZN11xercesc_3_19XMLString7releaseEPPwPNS_13MemoryManagerE.<br>
 
At Line 6977, modify _ZN11xercesc_3_19XMLString9transcodeEPKwPNS_13MemoryManagerE to _ZN11xercesc_3_19XMLString9transcodeEPKtPNS_13MemoryManagerE = _ZN11xercesc_3_19XMLString9transcodeEPKwPNS_13MemoryManagerE.<br>
 
At Line 6977, modify _ZN11xercesc_3_19XMLString9transcodeEPKwPNS_13MemoryManagerE to _ZN11xercesc_3_19XMLString9transcodeEPKtPNS_13MemoryManagerE = _ZN11xercesc_3_19XMLString9transcodeEPKwPNS_13MemoryManagerE.<br>
 
3.Run dlltool -d temp.txt -l libxerces-c_3.dll.a.<br>
 
3.Run dlltool -d temp.txt -l libxerces-c_3.dll.a.<br>
Line 48: Line 49:
 
This problem occurs because the number of User-defined types is different between CEGUI and its dependencies.<br>
 
This problem occurs because the number of User-defined types is different between CEGUI and its dependencies.<br>
 
<br>
 
<br>
Then, you launch cmake-gui, click configure, select the MinGW Makefiles generator, uncheck CEGUI_BUILD_RENDERER_OPENGL3 and generate.<br>
+
Then, you launch cmake-gui, click configure, select the MinGW Makefiles generator, uncheck CEGUI_BUILD_RENDERER_OPENGL3, reconfigure and generate.<br>
 
You should choose the target binary directory same as the source directory, because the reference to datafiles are fixed to the source directory.<br>
 
You should choose the target binary directory same as the source directory, because the reference to datafiles are fixed to the source directory.<br>
If Cmake works successfully, you can see the Makefile at the target binary directory you choose.<br>
+
If Cmake have worked successfully, you can see the Makefile at the target binary directory you choose.<br>
 
Build it.<br>
 
Build it.<br>
 
You could find built cegui-libraries at <cegui_binary_root>/bin.<br>
 
You could find built cegui-libraries at <cegui_binary_root>/bin.<br>

Revision as of 02:12, 25 October 2014

First, you need to download the CEGUI source package and its dependencies from The Official Site.
You also need to download and install CMake binary from here.

Second, you build the dependencies.
Build of the D3DX11 package is currently not supported. Moreover, this version of DirectX is deprecated.
You had better avoid using these features if possible.
Patch a few to build all packages successfully except for D3DX11.

In the pngwin.def at <dependencies_source_root>/src/libpng-1.4.7/scripts,
At Line 5, edit LIBRARY to LIBRARY libpng. libpng is the missing library name.

In the devil_internal_exports.h at <dependencies_source_root>/src/devil-1.7.8/include/IL,
At Line 29, change the definition of INLINE from external inline to static inline.
By this change, you can avoid some multiple definition error.

Then, you launch cmake-gui, click configure, select the MinGW Makefiles generator,
check all options except for CEGUI_BUILD_EFFECTS11 and CEGUI_GNUtoMS, configure again and generate.
If Cmake have worked successfully, you can see the Makefile at the target binary directory you choose.
Build it.
You could find built dependencies at <dependencies_binary_root>/dependencies.

Third, you build the CEGUI.
Move the dependencies directory where you built dependencies from <dependencies_binary_root> to <cegui_source_root>.

You also need to modify some files.

In the CMakeLists.txt at <cegui_source_root>/cegui/src,
Between Line 84 and Line 85, you have to add
if(MINGW)
target_link_libraries(${CEGUI_TARGET_NAME} <mingw_root>/lib/libshlwapi.a)
endif ()
This library is needed for the build of MiniZipResourceProvider.

And to solve the C++ mangling problem, you have to remake an import library to libxerces-c_3.dll.
To do this,
1.Export the .def file from libxerces-c_3.dll at <cegui_source_root>/dependencies/bin.
2.Modify the exported .def file.
3.Remake an import library from modified .def file.
4.Replace the libxerces-c_3.dll.a at <cegui_source_root>/dependencies/lib/dynamic/ with the new import library.

For example, with the built-in MinGW dlltool,
1.Run dlltool --export-all-symbols libxerces-c_3.dll -z temp.txt
2.Edit the temp.txt.
At Line 6919, modify _ZN11xercesc_3_19XMLString7releaseEPPwPNS_13MemoryManagerE to _ZN11xercesc_3_19XMLString7releaseEPPtPNS_13MemoryManagerE = _ZN11xercesc_3_19XMLString7releaseEPPwPNS_13MemoryManagerE.
At Line 6977, modify _ZN11xercesc_3_19XMLString9transcodeEPKwPNS_13MemoryManagerE to _ZN11xercesc_3_19XMLString9transcodeEPKtPNS_13MemoryManagerE = _ZN11xercesc_3_19XMLString9transcodeEPKwPNS_13MemoryManagerE.
3.Run dlltool -d temp.txt -l libxerces-c_3.dll.a.
4.Replace.

This problem occurs because the number of User-defined types is different between CEGUI and its dependencies.

Then, you launch cmake-gui, click configure, select the MinGW Makefiles generator, uncheck CEGUI_BUILD_RENDERER_OPENGL3, reconfigure and generate.
You should choose the target binary directory same as the source directory, because the reference to datafiles are fixed to the source directory.
If Cmake have worked successfully, you can see the Makefile at the target binary directory you choose.
Build it.
You could find built cegui-libraries at <cegui_binary_root>/bin.
Copy the dll files at <cegui_source_root>/dependencies/bin to this directory.

Finally, launch CEGUISampleFramework-0.8.
If you have successfully built all the things, you may enjoy a bunch of cegui demo.
Congratulations!