ubuntu 14 下luabind编译安装

来源:互联网 发布:网络分流器厂家 编辑:程序博客网 时间:2024/04/30 20:20

luabind 下载官网的luabind-0.9.1.tar.gz

1.安装boost (官网最新1.61)

   基本的安装在boost的README或者INSTALL里面都有,不多说


2.安装lua(官网下载5.1)

   我安装了5.1 ,5.2,5.3 

   只有安装5.1的时候,luabind才可以编译通过(鬼知道)

   问题:

   64位机器需要在src/Makefile下面CFLAGS里添加加上-fPIC,不然后面luabind编译时候会出现下面

   /usr/bin/ld: /usr/local/lib/liblua.a(lapi.o):

   relocation R_X86_64_32 against `luaO_nilobject_' can not be used when making a shared object;

   recompile with -fPIC

   /usr/local/lib/liblua.a: could not read symbols: Bad value


3.编译luabind

   基本就是一个bjam

   难解决的问题两个:

    1.object.hpp:556: error: no matching function for call to ‘operator==( ... 

      最终就是LUABIND_OPERATOR_ADL_WKND(==) 这两行,我直接注释了(只为编译过。。。)

      //LUABIND_OPERATOR_ADL_WKND(==)
 
    //LUABIND_OPERATOR_ADL_WKND(!=)

    2.call_member.hpp:319: error: missing binary operator before token "(" ... 

     这个问题网上可以搜到,是宏定义用了

     #elif BOOST_PP_ITERATION_DEPTH() == 1 

     ... 

    #endif

    修改方式是拆分:

    #else

    #if BOOST_PP_ITERATION_DEPTH() == 1

    ... 

   #endif

   #endif


然后在使用bjam 和 bjam install

 编译安装可以通过


0 0
原创粉丝点击