gpt4 book ai didi

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

转载 作者:太空宇宙 更新时间:2023-11-04 12:52:25 25 4
gpt4 key购买 nike

我正在尝试构建一个用 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com