错误:标记"("之前缺少二元运算符。

我的项目在 gcc 升级后因为以下错误无法构建:

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/ockonal/Workspace/themisto/engine/include/Scripting/ScriptManager.hpp:21,
                 from /home/ockonal/Workspace/themisto/engine/source/Core/Root.cpp:28:
/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/ockonal/Workspace/themisto/engine/include/Scripting/ScriptManager.hpp:21,
                 from /home/ockonal/Workspace/themisto/engine/source/Core/Root.cpp:28:
/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/ockonal/Workspace/themisto/engine/include/Scripting/ScriptManager.hpp:21,
                 from /home/ockonal/Workspace/themisto/engine/source/Core/Root.cpp:28:
/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/ockonal/Workspace/themisto/engine/include/Scripting/ScriptManager.hpp:21,
                 from /home/ockonal/Workspace/themisto/engine/source/Core/Root.cpp:28:
/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/ockonal/Workspace/themisto/engine/include/Scripting/ScriptManager.hpp:21,
                 from /home/ockonal/Workspace/themisto/engine/source/Core/Root.cpp:28:
/usr/include/luabind/detail/call_member.hpp:319:1: error: missing binary operator before token "("

怎么回事?我也尝试了最新的 gcc (4.8)快照,但也没有帮助。

附注:

extra/boost 1.49.0-1 [已安装]
core/gcc 4.6.3-1 (base-devel) [已安装]
aurbuild/luabind 0.9.1-1 [已安装]

原文链接 https://stackoverflow.com/questions/9631762

点赞
stackoverflow用户812912
stackoverflow用户812912

由于 luabind 作为谷歌谷歌项目出现,我能够浏览代码并找到哪些行引起错误。它们看起来像这样:

#elif BOOST_PP_ITERATION_FLAGS() == 1

似乎其他人也遇到了这个问题,我找到了这个讨论串,我希望能帮助你。

2012-03-09 10:22:03