Compile lua and luabind in VC

Source: Internet
Author: User
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

  • Source code download

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 a project

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

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.