目前我正在尝试使用 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 中的一个错误。它说改变
#elif BOOST_PP_ITERATION_FLAGS() == 1
和 :
#else
#if BOOST_PP_ITERATION_FLAGS() == 1
纠正问题。所以我修改了文件/usr/include/luabind/wrapper_base.hpp,就像它说的那样。但它不起作用。
后来我发现有一个补丁可以解决这个问题。但我不知道如何将该补丁添加到 luabind。请告诉我该怎么做。提前致谢。