Lua_icxx  1.02 (Aug 2011)
Installation

Requirements: any Lua 5.1

If building from source:

  • do an SVN checkout as explained on the SVN page for lua-icxx
  • to build for MS Windows, using Visual Studio:
    1. open the Visual Studio solution file in vs-2005-sln, select Release build
    2. adjust the include and libs paths if necessary
    3. build; this puts the headers in "dist/include" folder and binaries in the "dist/lib"

If installing from binary distribution:

To install for use in your applications:

  1. install header files:
    • copy the contents of the "include" folder from the zip file (or dist folder, after building, if using the source distribution) to a folder of your choice. A good place is in the include folder of the Lua distribution you want to use, since this will be on your INCLUDES path already for using Lua header files (which are included by lua_icxx).
    • This would result in a Lua 5.1 include folder that contains a folder "lua_icxx" that contains the Lua_icxx headers, and your #include statements will be of the form #include "lua_icxx\Lua....h".
  2. install binary:
    • copy the lua_icxx.* from the zip file's lib folder (or dist/lib folder, after building, if using the source distribution) to a folder of your choice. A good place is in the folder that contains the Lua binaries, since this will already be on your LIBRARIES path for linking to the Lua libraries.

Example installation on Windows (using LuaForWindows):

C:\Program Files
  \- Lua
       \- 5.1
           |- include
           |   |- lua.h
           |   |- lauxlib.h
           |   |- ...
           |   |- lua_icxx
           |        |- LuaInterpreter.h
           |        \- ...
           \- lib
               |- lua_icxx.lib
               |- lua_icxx.dll
               |- lua5.1.dll
               \- ...

Usage

  • your source file:
        #include "lua_icxx\LuaInterpreter.h"
        void main() {
            ...
            LuaInterpreter lua;
            ...
        }
    
  • Visual Studio settings:
    • for compiling:
              AdditionalIncludeDirectories="$(LUA_INCLUDE)"
      
    • linking:
              AdditionalDependencies="lua51.lib;lua_icxx.lib"
              AdditionalLibraryDirectories="$(LUA_BINARIES)"