LoginSignup
2
1

More than 5 years have passed since last update.

Visual Studio 2015 で luabind 0.9.1 をビルドする

Posted at

はじめに

Visual Studio 2015 + Lua 5.1.5 + Boost 1.60.0 で luabind 0.9.1 のスタティックライブラリ(.lib)を作成する手順です。今回は 32bit 版を作成していますが、同様の手順で 64bit 版を作成する事も可能です。各ライブラリの配置先は環境に合わせて読み替えてください。

用意するもの

  • Visual Studio 2015 Community
  • luabind 0.9.1
  • Lua 5.1.5 (LuaBinaries から lua-5.1.5_Win32_dll14_lib.zip をダウンロード)
    • C:\lib\lua-5.1.5_Win32_dll14_lib へ配置
  • Boost 1.60.0
    • C:\lib\boost_1_60_0 へ配置

luabind/object.hpp の修正

最近のバージョンの Boost でコンパイルに失敗する箇所の修正を行います。

boost::operatorboost::iterators::operator へ置換します。

参考:BoostLibrary1.57.0を用いてLuaBindをビルドする際の問題

b2.exe を生成

Boost のフォルダで bootstrap.bat を実行すると b2.exe が生成されるので、これを luabind のフォルダへコピーします。

luabind のビルド

「開発者コマンドプロンプト for VS2015」を起動し、luabind のフォルダへ移動して以下を実行すると、stage フォルダに libluabind.lib (リリースビルド版)と libluabindd.lib (デバッグビルド版)が生成されます。

SET LUA_PATH=C:\lib\lua-5.1.5_Win32_dll14_lib
SET BOOST_ROOT=C:\lib\boost_1_60_0
b2 --toolset=msvc-14.0 address-model=32 link=static runtime-link=static debug release stage
2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1