构建C ++项目时引发相关错误

时间:2018-01-21 17:57:45

标签: c++ boost scons

我试图构建一个用C ++(https://sourceforge.net/p/open-chicken-invaders/code/HEAD/tree/trunk/)编写的旧游戏的克隆,但我得到了一些我无法解决的与Boost相关的错误。我尝试在Windows,Ubuntu和Raspberry Pi上构建这个项目,但每次都会遇到相同的错误。开发人员处于非活动状态,我无法与他联系。

pi@raspberrypi:~ $ cd openci
pi@raspberrypi:~/openci $ scons
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
g++ -o audio/controller_holder.o -c "`sdl2-config --cflags`" -Wextra -I. -DUSE_BOOST_CHRONO -DBOOST_SP_DISABLE_THREADS -DTIXML_USE_STL -O3 -DNDEBUG audio/controller_holder.cpp
In file included from ./context/objects_storage.h:27:0,
                 from ./objects/base/object.h:24,
                 from ./objects/base/active.h:24,
                 from audio/controller_holder.h:24,
                 from audio/controller_holder.cpp:22:
/usr/include/boost/move/detail/type_traits.hpp:1059:4: error: 'Align' is not a type
    BOOST_STATIC_ASSERT(Align > 0);
    ^
/usr/include/boost/move/detail/type_traits.hpp:1059:4: error: expected ',' or '...' before '>' token
    BOOST_STATIC_ASSERT(Align > 0);
    ^
./portability/cpp11.h:29:75: error: ISO C++ forbids declaration of 'BOOST_STATIC_ASSERT' with no type [-fpermissive]
 #   define static_assert(condition, message) BOOST_STATIC_ASSERT(condition)
                                                                           ^
/usr/include/boost/move/detail/type_traits.hpp:1064:4: error: 'value' is not a type
    BOOST_STATIC_ASSERT(value >= Align);
    ^
/usr/include/boost/move/detail/type_traits.hpp:1064:4: error: expected ',' or '...' before '>=' token
    BOOST_STATIC_ASSERT(value >= Align);
    ^
./portability/cpp11.h:29:75: error: ISO C++ forbids declaration of 'BOOST_STATIC_ASSERT' with no type [-fpermissive]
 #   define static_assert(condition, message) BOOST_STATIC_ASSERT(condition)
                                                                           ^
./portability/cpp11.h:29:46: error: 'int boost::move_detail::aligned_storage<Len, Align>::BOOST_STATIC_ASSERT(int)' cannot be overloaded
 #   define static_assert(condition, message) BOOST_STATIC_ASSERT(condition)
                                              ^
./portability/cpp11.h:29:46: error: with 'int boost::move_detail::aligned_storage<Len, Align>::BOOST_STATIC_ASSERT(int)'
 #   define static_assert(condition, message) BOOST_STATIC_ASSERT(condition)
                                              ^
/usr/include/boost/move/detail/type_traits.hpp:1065:4: error: expected identifier before '(' token
    BOOST_STATIC_ASSERT((value % Align) == 0);
    ^
/usr/include/boost/move/detail/type_traits.hpp:1065:4: error: expected ')' before '%' token
    BOOST_STATIC_ASSERT((value % Align) == 0);
    ^
/usr/include/boost/move/detail/type_traits.hpp:1065:4: error: expected ')' before '%' token
/usr/include/boost/move/detail/type_traits.hpp:1065:4: error: expected ';' at end of member declaration
    BOOST_STATIC_ASSERT((value % Align) == 0);
    ^
/usr/include/boost/move/detail/type_traits.hpp:1065:4: error: expected unqualified-id before '%' token    BOOST_STATIC_ASSERT((value % Align) == 0);
    ^
scons: *** [audio/controller_holder.o] Error 1
scons: building terminated because of errors.
pi@raspberrypi:~/openci $

我在其他地方读过Boost没有正确配置。我已经使用apt-get install libboost1.62-all安装了它。 (在Raspberry Pi 3上)。

我该怎么办?

1 个答案:

答案 0 :(得分:0)

项目使用gcc 4.6boost 1.58编译好。