Compilation of Lua and luabind under VC
Lua 13:14:37 read 1843 comments 5 font size:Medium and largeSmall
Compilation of lua and luabind under VC
Yang Mingzhe
Using vs2008, I believe vs2005 is also applicable
Download lua
Http://www.lua.org/download.html
The version I got is 5.1.4.
Download luabind
Http://sourceforge.net/projects/luabind/
The version I got is 0.7.
Download boost
Http://sourceforge.net/projects/boost/
The latest version is 1.36.0, and my network is slow. I will use the existing 1.35.0 first.
Boost does not need to be compiled. luabind only needs its header file during compilation.
Create VC projects for Lua and luabind respectively
File> New> Create a project from the existing code, and then follow the Wizard to select a static library project
Lua creates a project as Lua, accurate to the lua-5.1.4 \ SRC folder
Luabind build project as luabind, precise to luabind-0.7 \ luabind \ SRC folder
Create virtual folders luabind and luabind \ detail in the luabind project, and add the header files from the disk luabind-0.7 \ luabind to the Project
Finally, add the two projects to a solution Lua.
Compile Lua Project
Remove Lua. C and luac. c from production or from project
Modify project properties:
Set Properties> General> character set to use multi-Byte Character Set
Configure Properties> C/C ++> General> check 64-bit portability
Configure Properties> C/C ++> advanced> disable specific warnings to 4996
Compiled
Compile the LuaBind Project
Modify project properties:
General Properties> framework and reference> Add new reference add reference to Lua Project
Set Properties> General> character set to use multi-Byte Character Set
Configure Properties> C/C ++> General> check 64-bit portability
Configure Properties> C/C ++> advanced> disable specific warnings to 4996
Configure Properties> General> Add include directory Add references to the lua-5.1.4 \ src, luabind-0.7 \ luabind \, boost_1_35_0 directory, of course you need to change the form of relative path according to your local file directory structure. For example
../; Http://www.cnblogs.com/../lua-5.1.4/src;http://www.cnblogs.com/../boost_1_35_0
Change luaconf. h 322 line # undef LUA_COMPAT_GETN of Lua project to # define LUA_COMPAT_GETN
In LuaBind project lua_include