Installation

From KlayGE
Revision as of 02:05, 19 November 2013 by Gongminmin (Talk | contribs)

Jump to: navigation, search

Before compiling KlayGE, Python 2.7+ and CMake 2.8.6+ must be installed first. Then you can run build_external.py to build and install third-party libraries and tools. KlayGE has been tested on these compilers.

Since KlayGE 3.12.0, include and lib paths are set up inside the project files. After extraction, just open the corresponding project file under "Build" directory, KlayGE itself can be built directly. Or you can run build_all.py to do that job.

Since KlayGE 4.1.0, project files are migrated to cmake. Several on-stop compiling scripts written in Python is also included. The build_glloader.py is used for compiling glloader; the build_kfont.py for kfont; the build_KlayGE.py for KlayGE, Samples, Tools and Tutorials. The build_all.py can build all of them. Those .py have two optional parameters. The first one is compiler name, the second one is configuration name. For example, "build_all.py vc10 x64" means uses vc10's x64 configuration for compiling. Currently, compiler names such as vc8, vc9, vc10, vc11, vc12, mingw and gcc are supported. Configuration names such as x86, x64, x86_app, and arm_app are supported. If no parameter in the command line, default parameters inside cfg_build.py will be used.

During the compilation, if the vc said couldn't find v110_xp toolset, please install Visual Studio 2012 Update or up.

Notes for MinGW users:

There are some incompatibilities between new versions of the Windows SDK/DirectX SDK and MinGW. When compiling the DirectSound plug-in, and the compiler will report sal.h cannot be found. VC's "sal.h" needs to be copied to "MinGW/include". Then open "MinGW/lib/gcc/mingw32/4.4.1/include/stddef.h", replace "#define NULL __null" by "#define NULL 0". Otherwise, sal.h will define __null to some other token incorrectly.