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
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
First, you need to download the CEGUI source package and its dependencies from [http://cegui.org.uk/download The Official Site].<br>
 
First, you need to download the CEGUI source package and its dependencies from [http://cegui.org.uk/download The Official Site].<br>
You also need to download and install CMake binary from [http://www.cmake.org/download/ here].<br>
+
You also need to download a CMake binary from [http://www.cmake.org/download/ here].<br>
 
<br>
 
<br>
 
Second, you build the dependencies.<br>
 
Second, you build the dependencies.<br>
 
Build of the D3DX11 package is currently not supported. Moreover, this version of DirectX is deprecated.<br>
 
Build of the D3DX11 package is currently not supported. Moreover, this version of DirectX is deprecated.<br>
You had better avoid using these features if possible.<br>
+
You had better avoid using this feature if possible.<br>
 
Patch a few to build all packages successfully except for D3DX11.<br>
 
Patch a few to build all packages successfully except for D3DX11.<br>
 
<br>
 
<br>
 
In the pngwin.def at <dependencies_source_root>/src/libpng-1.4.7/scripts,<br>
 
In the pngwin.def at <dependencies_source_root>/src/libpng-1.4.7/scripts,<br>
At Line 5, edit LIBRARY to LIBRARY libpng. libpng is the missing library name.<br>
+
At the Line 5, modify LIBRARY to LIBRARY libpng. libpng is the missing library name.<br>
 
<br>
 
<br>
 
In the devil_internal_exports.h at <dependencies_source_root>/src/devil-1.7.8/include/IL,<br>
 
In the devil_internal_exports.h at <dependencies_source_root>/src/devil-1.7.8/include/IL,<br>
At Line 29, change the definition of INLINE from external inline to static inline.<br>
+
At the Line 29, change the definition of INLINE from external inline to static inline.<br>
 
By this change, you can avoid some multiple definition error.<br>
 
By this change, you can avoid some multiple definition error.<br>
 
<br>
 
<br>
Then, you launch cmake-gui, click configure, select the MinGW Makefiles generator,<br>
+
Then, 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 can find the built dependencies at <dependencies_binary_root>/dependencies.<br>
 
<br>
 
<br>
 
Third, you build the CEGUI.<br>
 
Third, you build the CEGUI.<br>
You need to move dependencies you built from <dependencies_binary_root> to <cegui_source_root>.<br>
+
Move the dependencies directory where you built the dependencies from <dependencies_binary_root> to <cegui_source_root>.<br>
 
<br>
 
<br>
 
You also need to modify some files.<br>
 
You also need to modify some files.<br>
 
<br>
 
<br>
 
In the CMakeLists.txt at <cegui_source_root>/cegui/src,<br>
 
In the CMakeLists.txt at <cegui_source_root>/cegui/src,<br>
Between Line 84 and Line 85, you have to add<br>
+
Between the Line 84 and the Line 85, you have to add<br>
 
if(MINGW)<br>
 
if(MINGW)<br>
 
target_link_libraries(${CEGUI_TARGET_NAME} <mingw_root>/lib/libshlwapi.a)<br>
 
target_link_libraries(${CEGUI_TARGET_NAME} <mingw_root>/lib/libshlwapi.a)<br>
 
endif ()<br>
 
endif ()<br>
 +
Do not forget to replace <mingw_root> with the path to the root directory of the MinGW on your PC.<br>
 
This library is needed for the build of MiniZipResourceProvider.<br>
 
This library is needed for the build of MiniZipResourceProvider.<br>
 
<br>
 
<br>
And to solve the C++ mangling problem, you have to remake an import library to libxerces-c_3.dll.<br>
+
And to solve the C++ mangling problem, you have to remake an import library for the libxerces-c_3.dll.<br>
 
To do this,<br>
 
To do this,<br>
 
1.Export the .def file from libxerces-c_3.dll at <cegui_source_root>/dependencies/bin.<br>
 
1.Export the .def file from libxerces-c_3.dll at <cegui_source_root>/dependencies/bin.<br>
 
2.Modify the exported .def file.<br>
 
2.Modify the exported .def file.<br>
3.Remake an import library from modified .def file.<br>
+
3.Remake an import library from the modified .def file.<br>
4.Replace the libxerces-c_3.dll.a at <cegui_root>/dependencies/lib/dynamic/ with the new import library.<br>
+
4.Replace the libxerces-c_3.dll.a at <cegui_source_root>/dependencies/lib/dynamic/ with the new import library.<br>
 
<br>
 
<br>
 
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 6977, modify _ZN11xercesc_3_19XMLString9transcodeEPKwPNS_13MemoryManagerE to _ZN11xercesc_3_19XMLString9transcodeEPKtPNS_13MemoryManagerE = _ZN11xercesc_3_19XMLString9transcodeEPKwPNS_13MemoryManagerE.<br>
+
At the Line 6919, modify _ZN11xercesc_3_19XMLString7releaseEPPwPNS_13MemoryManagerE to _ZN11xercesc_3_19XMLString7releaseEPPtPNS_13MemoryManagerE = _ZN11xercesc_3_19XMLString7releaseEPPwPNS_13MemoryManagerE.<br>
 +
At the 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>
4.Replace.<br>
+
4.Replace the old one with the new one.<br>
 
<br>
 
<br>
This problem occurs because the number of User-defined types is different between CEGUI and its dependencies.<br>
+
This problem occurs because the mangling order of User-defined types is not necessarily the same between the 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, 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 is fixed to the source directory.<br>
If Cmake works successfully, you can see the Makefile at the target binary directory you choose.<br>
+
Note that OPENGL3 is not supported for this installation on Windows.<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-library at <cegui_target_root>/bin.<br>
+
You can find the built cegui-libraries at <cegui_binary_root>/bin.<br>
Copy the dll files at <cegui_root>/dependencies/bin to this directory.<br>
+
Copy the dll files at <cegui_source_root>/dependencies/bin to this directory.<br>
 
<br>
 
<br>
 
Finally, launch CEGUISampleFramework-0.8.<br>
 
Finally, launch CEGUISampleFramework-0.8.<br>
If you have successfully built all the things, you may enjoy a bunch of cegui demo.<br>
+
If you have successfully built all the things, you may enjoy a bunch of cegui demos.<br>
 
Congratulations!<br>
 
Congratulations!<br>
  
 
[[Category:Tutorials]]
 
[[Category:Tutorials]]

Latest revision as of 07:29, 27 October 2014

First, you need to download the CEGUI source package and its dependencies from The Official Site.
You also need to download a 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 this feature 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 the Line 5, modify 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 the Line 29, change the definition of INLINE from external inline to static inline.
By this change, you can avoid some multiple definition error.

Then, 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 can find the built dependencies at <dependencies_binary_root>/dependencies.

Third, you build the CEGUI.
Move the dependencies directory where you built the 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 the Line 84 and the Line 85, you have to add
if(MINGW)
target_link_libraries(${CEGUI_TARGET_NAME} <mingw_root>/lib/libshlwapi.a)
endif ()
Do not forget to replace <mingw_root> with the path to the root directory of the MinGW on your PC.
This library is needed for the build of MiniZipResourceProvider.

And to solve the C++ mangling problem, you have to remake an import library for the 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 the 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 the Line 6919, modify _ZN11xercesc_3_19XMLString7releaseEPPwPNS_13MemoryManagerE to _ZN11xercesc_3_19XMLString7releaseEPPtPNS_13MemoryManagerE = _ZN11xercesc_3_19XMLString7releaseEPPwPNS_13MemoryManagerE.
At the 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 the old one with the new one.

This problem occurs because the mangling order of User-defined types is not necessarily the same between the CEGUI and its dependencies.

Then, 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 is fixed to the source directory.
Note that OPENGL3 is not supported for this installation on Windows.
If Cmake have worked successfully, you can see the Makefile at the target binary directory you choose.
Build it.
You can find the 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 demos.
Congratulations!