1

after gcc upgrade my project fails to build due to the error:

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 "("

What could it be? I've also tried latest gcc (4.8) snapshot but it didn't help.

p.s.

extra/boost 1.49.0-1 [installed]
core/gcc 4.6.3-1 (base-devel) [installed]
aurbuild/luabind 0.9.1-1 [installed]
Ivaylo Strandjev
  • 69,226
  • 18
  • 123
  • 176
Max Frai
  • 61,946
  • 78
  • 197
  • 306
  • 2
    Could you please provide minimal code around at least one of the cases for which the error is output? – Ivaylo Strandjev Mar 09 '12 at 09:54
  • @izomorphius the error isn't related to my code. I've removed luabind and downloaded latest stable release. I can't build it due to this errors in given files (from error output). – Max Frai Mar 09 '12 at 09:57
  • 1
    all these lines where you get an error are similar to `#elif BOOST_PP_ITERATION_FLAGS() == 1` – Ivaylo Strandjev Mar 09 '12 at 10:09
  • I have changed the summary of your question to make it easier to find it if one searches for the error. – Ivaylo Strandjev Mar 09 '12 at 12:01
  • And if your search arrives at this page, but you got this error without boost, see [here](http://stackoverflow.com/q/21338385/10396) for a more general explanation of the message. – AShelly Feb 27 '14 at 12:02

1 Answers1

8

As luabind is present as a google google project I was able to browse the code and find which lines are causing the error. They all look like:

#elif BOOST_PP_ITERATION_FLAGS() == 1

It seems others have run into this problem and I found this thread that I hope will help you.

Ivaylo Strandjev
  • 69,226
  • 18
  • 123
  • 176
  • Thanks. Maybe, you know how to fix it: `#define BOOST_PP_ITERATION_PARAMS_1 (4, (0, LUABIND_MAX_ARITY, , 1))` I have never worked with this macro from BOOST. – Max Frai Mar 09 '12 at 10:38
  • 1
    As far as I see it the guy simply changes an elif to else if and this seems to fix the problem. Doesn't it work for you? – Ivaylo Strandjev Mar 09 '12 at 10:44
  • In wrapper_base.hpp, after adding `#else` and `#if` around line 93, you need to add an extra `#endif` at the end of the file. – pedromateo Sep 24 '14 at 11:21