c++ - 在构建 C++ 项目时增加相关错误

标签 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 安装了它。 (在树莓派 3 上)。

我能做什么?

最佳答案

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

关于c++ - 在构建 C++ 项目时增加相关错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48369950/

相关文章:

python - 如何使 C 枚举类型可用于其他语言?

带有 QList 的 C++ 多客户端 TCP 服务器

c++ - 如何在不先将整个文件读入内存的情况下使用 Boost::Spirit::Lex 对文件进行 lex?

c++ - 在 "chunks"中处理的互斥管理线程而不是交错

c++ - boost::graph 中的 DFS 更改图形内容

scons - 强制 SCons 在 64 位 Windows 上使用 32 位 MSVC 编译器

fortran - 为什么SCons构建的成功取决于variant_dir名称?

C++ 将 DNS 条目添加到网络适配器中

linux - 有没有办法从 make 调用中获取 -j 参数?

c++ - 图像处理 : luminance weighted 2