目前我正在尝试使用boost构建项目。但它会显示一条错误消息,指示缺少运算符。
[ 6%] Building CXX object CMakeFiles/osrm-extract.dir/extractor.cpp.o
In file included from /usr/include/luabind/wrapper_base.hpp:31:0,
from /usr/include/luabind/back_reference.hpp:27,
from /usr/include/luabind/class.hpp:93,
from /usr/include/luabind/luabind.hpp:28,
from /home/mwh/Desktop/Downloads/Project-OSRM-master/Extractor/ScriptingEnvironment.h:29,
from /home/mwh/Desktop/Downloads/Project-OSRM-master/extractor.cpp:23:
/usr/include/luabind/detail/call_member.hpp:319:1: error: missing binary operator before token "("
In file included from /usr/include/luabind/back_reference.hpp:27:0,
from /usr/include/luabind/class.hpp:93,
from /usr/include/luabind/luabind.hpp:28,
from /home/mwh/Desktop/Downloads/Project-OSRM-master/Extractor/ScriptingEnvironment.h:29,
from /home/mwh/Desktop/Downloads/Project-OSRM-master/extractor.cpp:23:
/usr/include/luabind/wrapper_base.hpp:92:1: error: missing binary operator before token "("
In file included from /usr/include/luabind/function.hpp:10:0,
from /usr/include/luabind/class.hpp:94,
from /usr/include/luabind/luabind.hpp:28,
from /home/mwh/Desktop/Downloads/Project-OSRM-master/Extractor/ScriptingEnvironment.h:29,
from /home/mwh/Desktop/Downloads/Project-OSRM-master/extractor.cpp:23:
/usr/include/luabind/detail/call_function.hpp:326:1: error: missing binary operator before token "("
In file included from /usr/include/luabind/detail/constructor.hpp:12:0,
from /usr/include/luabind/class.hpp:96,
from /usr/include/luabind/luabind.hpp:28,
from /home/mwh/Desktop/Downloads/Project-OSRM-master/Extractor/ScriptingEnvironment.h:29,
from /home/mwh/Desktop/Downloads/Project-OSRM-master/extractor.cpp:23:
/usr/include/luabind/wrapper_base.hpp:92:1: error: missing binary operator before token "("
In file included from /usr/include/luabind/class.hpp:107:0,
from /usr/include/luabind/luabind.hpp:28,
from /home/mwh/Desktop/Downloads/Project-OSRM-master/Extractor/ScriptingEnvironment.h:29,
from /home/mwh/Desktop/Downloads/Project-OSRM-master/extractor.cpp:23:
/usr/include/luabind/detail/call_member.hpp:319:1: error: missing binary operator before token "("
make[2]: *** [CMakeFiles/osrm-extract.dir/extractor.cpp.o] Error 1
make[1]: *** [CMakeFiles/osrm-extract.dir/all] Error 2
make: *** [all] Error 2
我做了一些研究,发现它实际上是luabind中的bug。它说改变了
#elif BOOST_PP_ITERATION_FLAGS() == 1
with:
#else
#if BOOST_PP_ITERATION_FLAGS() == 1
更正问题。所以我修改了文件/usr/include/luabind/wrapper_base.hpp。但它不起作用。
后来我发现有一个patch可以解决这个问题。但我不知道如何将该补丁添加到luabind。请告诉我怎么做。提前谢谢。
答案 0 :(得分:2)
我遇到了同样的问题。
我正在使用Ubuntu 12.04,提升1.49,luabind 0.9.1,g ++ 4.6.3,而且这个提升与luabind之间似乎存在不兼容。
只有这些版本,在办公室我有1.41和luabind 0.9.0,他们工作正常。
修改强>
实际上在修改了3个文件之后:call_function.hpp,call_member.hpp和wrapper_base.hpp,如the webpage you mentioned中所述。那样:
#elif BOOST_PP_ITERATION_FLAGS() == 1
...
#end
替换为:
#else
#if BOOST_PP_ITERATION_FLAGS() == 1
...
#end
#end
我能够编译我的luabind程序。
也许你忘了添加第二个#end?