【问题标题】:Raspberry PI GCC 4.8.2 build boost 1.56 atomic errorRaspberry PI GCC 4.8.2 build boost 1.56 原子错误
【发布时间】:2015-03-15 05:32:47
【问题描述】:

我尝试在我的树莓派上使用 c++11 构建 1.56 boost 库。大多数库都构建正确,但 boost atomic 会产生以下错误:

构建 Boost C++ 库。

Component configuration:

    - atomic                   : building
    - chrono                   : not building
    - container                : not building
    - context                  : not building
    - coroutine                : not building
    - date_time                : not building
    - exception                : not building
    - filesystem               : not building
    - graph                    : not building
    - graph_parallel           : not building
    - iostreams                : not building
    - locale                   : not building
    - log                      : not building
    - math                     : not building
    - mpi                      : not building
    - program_options          : not building
    - python                   : not building
    - random                   : not building
    - regex                    : not building
    - serialization            : not building
    - signals                  : not building
    - system                   : not building
    - test                     : not building
    - thread                   : not building
    - timer                    : not building
    - wave                     : not building

...found 129 targets...
...updating 8 targets...

gcc.compile.c++ bin.v2/libs/atomic/build/gcc-4.8/release/threading-multi/lockpool.o
g++: error: unrecognized command line option ‘-std=cxx11’

    "g++"  -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -pthread -fPIC -std=cxx11 -DBOOST_ALL_NO_LIB=1 -DBOOST_ATOMIC_DYN_LINK=1 -DBOOST_ATOMIC_SOURCE -DNDEBUG  -I"." -c -o "bin.v2/libs/atomic/build/gcc-4.8/release/threading-multi/lockpool.o"

"libs/atomic/src/lockpool.cpp"

...failed gcc.compile.c++ bin.v2/libs/atomic/build/gcc-4.8/release/threading-multi/lockpool.o...
...skipped <pbin.v2/libs/atomic/build/gcc-4.8/release/threading-multi>libboost_atomic.so.1.56.0

因为缺乏 锁池.o... ...由于缺少 libboost_atomic.so.1.56.0 而跳过了 libboost_atomic.so.1.56.0 ... ...跳过 libboost_atomic.so 因为缺少 libboost_atomic.so.1.56.0 ... gcc.compile.c++ bin.v2/libs/atomic/build/gcc-4.8/release/link-static/threading-multi/lockpool.o g++:错误:无法识别的命令行选项'-std=cxx11'

    "g++"  -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -pthread -std=cxx11 -DBOOST_ALL_NO_LIB=1 -DBOOST_ATOMIC_SOURCE -DBOOST_ATOMIC_STATIC_LINK=1 -DNDEBUG  -I"." -c -o "bin.v2/libs/atomic/build/gcc-4.8/release/link-static/threading-multi/lockpool.o"

"libs/atomic/src/lockpool.cpp"

...failed gcc.compile.c++ bin.v2/libs/atomic/build/gcc-4.8/release/link-static/threading-multi/lockpool.o...
...skipped <pbin.v2/libs/atomic/build/gcc-4.8/release/link-static/threading-multi>libboost_atomic.a(clean)

因为缺乏 锁池.o... ...跳过 libboost_atomic.a 由于缺乏 锁池.o... ...由于缺少 libboost_atomic.a 而跳过了 libboost_atomic.a ... ...未能更新 2 个目标... ...跳过了 6 个目标...

我做到了:

./bootstrap --with-libraries=atomic 
./b2 cxxflags="-std=cxx11"

有人知道我能做什么吗?

【问题讨论】:

  • 标志不是-std=c++11吗?

标签: c++ c++11 gcc boost


【解决方案1】:

正确的标志是-std=c++11,而不是-std=cxx11。只需使用以下命令运行您的命令:

./b2 cxxflags="-std=c++11"

【讨论】:

  • 对不起,我的意思是 -std=c++11 在这里输入错误,我使用正确的标志执行了命令,否则我会因为标志而出错。但我找到了我将其添加为答案的解决方案
【解决方案2】:
猜你喜欢
  • 1970-01-01
  • 2022-07-12
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-08-07
  • 2018-04-03
相关资源
最近更新 更多