无法识别的命令行选项'-std = c ++ 11'

杰克逊克尔

作为rasbian乳白色安装ROS的一部分,我必须手动安装我在遇到一个问题console-bridge

cc1plus: error: unrecognized command line option ‘-std=c++11’

据我所知,这是由于过时了,g++但是当我尝试更新它时:

$ sudo apt-get install --only-upgrade g++
Reading package lists... Done
Building dependency tree       
Reading state information... Done
g++ is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.

我该怎么做才能克服这个问题?

$ apt-get source -b console-bridge
Reading package lists... Done
Building dependency tree       
Reading state information... Done
NOTICE: 'console-bridge' packaging is maintained in the 'Git' version control system at:
git://anonscm.debian.org/debian-science/packages/console-bridge.git
Skipping already downloaded file 'console-bridge_0.3.2-1.dsc'
Skipping already downloaded file 'console-bridge_0.3.2.orig.tar.gz'
Skipping already downloaded file 'console-bridge_0.3.2-1.debian.tar.xz'
Need to get 0 B of source archives.
Skipping unpack of already unpacked source in console-bridge-0.3.2
dpkg-buildpackage: source package console-bridge
dpkg-buildpackage: source version 0.3.2-1
dpkg-buildpackage: source changed by Jose Luis Rivero <[email protected]>
dpkg-buildpackage: host architecture armhf
 dpkg-source --before-build console-bridge-0.3.2
 fakeroot debian/rules clean
dh  clean --parallel
   dh_testdir -O--parallel
   debian/rules override_dh_auto_clean
make[1]: Entering directory '/home/pi/ros_catkin_ws/external_src/console-bridge-0.3.2'
rm -f console_bridge-config.cmake
rm -f console_bridge.pc
dh_auto_clean --
make[1]: Leaving directory '/home/pi/ros_catkin_ws/external_src/console-bridge-0.3.2'
   dh_clean -O--parallel
 debian/rules build
dh  build --parallel
   dh_testdir -O--parallel
   dh_auto_configure -O--parallel
-- The C compiler identification is GNU 4.6.3
-- The CXX compiler identification is GNU 4.6.3
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- console_bridge version 0.3.0
-- Performing Test HAS_VISIBILITY
-- Performing Test HAS_VISIBILITY - Success
-- Configuring done
-- Generating done
-- Build files have been written to: /home/pi/ros_catkin_ws/external_src/console-bridge-0.3.2/obj-arm-linux-gnueabihf
   dh_auto_build -O--parallel
make[1]: Entering directory '/home/pi/ros_catkin_ws/external_src/console-bridge-0.3.2/obj-arm-linux-gnueabihf'
/usr/bin/cmake -H/home/pi/ros_catkin_ws/external_src/console-bridge-0.3.2 -B/home/pi/ros_catkin_ws/external_src/console-bridge-0.3.2/obj-arm-linux-gnueabihf --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /home/pi/ros_catkin_ws/external_src/console-bridge-0.3.2/obj-arm-linux-gnueabihf/CMakeFiles /home/pi/ros_catkin_ws/external_src/console-bridge-0.3.2/obj-arm-linux-gnueabihf/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[2]: Entering directory '/home/pi/ros_catkin_ws/external_src/console-bridge-0.3.2/obj-arm-linux-gnueabihf'
make -f CMakeFiles/console_bridge.dir/build.make CMakeFiles/console_bridge.dir/depend
make[3]: Entering directory '/home/pi/ros_catkin_ws/external_src/console-bridge-0.3.2/obj-arm-linux-gnueabihf'
cd /home/pi/ros_catkin_ws/external_src/console-bridge-0.3.2/obj-arm-linux-gnueabihf && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/pi/ros_catkin_ws/external_src/console-bridge-0.3.2 /home/pi/ros_catkin_ws/external_src/console-bridge-0.3.2 /home/pi/ros_catkin_ws/external_src/console-bridge-0.3.2/obj-arm-linux-gnueabihf /home/pi/ros_catkin_ws/external_src/console-bridge-0.3.2/obj-arm-linux-gnueabihf /home/pi/ros_catkin_ws/external_src/console-bridge-0.3.2/obj-arm-linux-gnueabihf/CMakeFiles/console_bridge.dir/DependInfo.cmake --color=
Scanning dependencies of target console_bridge
make[3]: Leaving directory '/home/pi/ros_catkin_ws/external_src/console-bridge-0.3.2/obj-arm-linux-gnueabihf'
make -f CMakeFiles/console_bridge.dir/build.make CMakeFiles/console_bridge.dir/build
make[3]: Entering directory '/home/pi/ros_catkin_ws/external_src/console-bridge-0.3.2/obj-arm-linux-gnueabihf'
/usr/bin/cmake -E cmake_progress_report /home/pi/ros_catkin_ws/external_src/console-bridge-0.3.2/obj-arm-linux-gnueabihf/CMakeFiles 2
[ 25%] Building CXX object CMakeFiles/console_bridge.dir/src/console.cpp.o
/usr/bin/c++   -Dconsole_bridge_EXPORTS -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2  -fvisibility=hidden -std=c++11 -Wall -Wextra -O3 -DNDEBUG -fPIC -I/home/pi/ros_catkin_ws/external_src/console-bridge-0.3.2/include    -o CMakeFiles/console_bridge.dir/src/console.cpp.o -c /home/pi/ros_catkin_ws/external_src/console-bridge-0.3.2/src/console.cpp
cc1plus: error: unrecognized command line option ‘-std=c++11’
CMakeFiles/console_bridge.dir/build.make:57: recipe for target 'CMakeFiles/console_bridge.dir/src/console.cpp.o' failed
make[3]: *** [CMakeFiles/console_bridge.dir/src/console.cpp.o] Error 1
make[3]: Leaving directory '/home/pi/ros_catkin_ws/external_src/console-bridge-0.3.2/obj-arm-linux-gnueabihf'
CMakeFiles/Makefile2:63: recipe for target 'CMakeFiles/console_bridge.dir/all' failed
make[2]: *** [CMakeFiles/console_bridge.dir/all] Error 2
make[2]: Leaving directory '/home/pi/ros_catkin_ws/external_src/console-bridge-0.3.2/obj-arm-linux-gnueabihf'
Makefile:126: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/home/pi/ros_catkin_ws/external_src/console-bridge-0.3.2/obj-arm-linux-gnueabihf'
dh_auto_build: make -j1 returned exit code 2
debian/rules:7: recipe for target 'build' failed
make: *** [build] Error 2
dpkg-buildpackage: error: debian/rules build gave error exit status 2
Build command 'cd console-bridge-0.3.2 && dpkg-buildpackage -b -uc' failed.
E: Child process failed

解决方案

在里面,console-bridge-0.3.2/CMakeLists.txt我发现以下行:

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wextra")

我改为:

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -Wall -Wextra")

进行更改后,我可以运行

$ apt-get source -b console-bridge

没有错误。

代词

GCC 4.6系列相当旧(2011-2012)。它最初在C ++ 11仍称为C ++ 0x时发布,因此它支持-std=c++0xswitch而不是std=c++11它对C ++ 11的支持还不够完善,因此使用C ++ 11功能的更现代的代码可能会编译也可能不会编译。

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

如何禁用gcc警告“ cc1:警告:命令行选项'-std = c ++ 11'对C ++ / ObjC ++有效,但对C无效(默认启用)”

来自分类Dev

C ++ 11 std :: array of std :: atomic零初始化无法编译?

来自分类Dev

C ++ 11嵌套std :: conditional

来自分类Dev

cc1plus:错误:无法识别的命令行选项“ -std = c ++ 11”

来自分类Dev

C 11 std ::线程奇怪的行为

来自分类Dev

C ++ 11:错误:“开始”不是“ std”的成员

来自分类Dev

将-std = c ++ 11传递给CMakeLists?

来自分类Dev

无法识别的命令行选项“ -WI”

来自分类Dev

在C ++ 11中从std :: deque移动元素

来自分类Dev

C ++ 11 std :: thread与Windows CreateThread

来自分类Dev

gcc:错误:无法识别的命令行选项“ -combine”

来自分类Dev

使用nvcc / CUDA / cmake无法摆脱“警告:命令行选项'-std = c ++ 11'”

来自分类Dev

makefile不适用于-std = c ++ 11选项

来自分类Dev

C ++ 11:从模板函数构建std :: tuple

来自分类Dev

命令行警告D9002:忽略未知选项'-std = c ++ 11'

来自分类Dev

Eclipse / g ++无法识别“ -std = c ++ 11”标志

来自分类Dev

cc1plus:错误:无法识别的命令行选项“ -std = c ++ 0x”

来自分类Dev

C ++ 11中std :: is_base_of的逻辑

来自分类Dev

播种std :: rand / c ++ 11 <random>

来自分类Dev

C 11 std ::转发指针

来自分类Dev

C ++ 11 std :: regex替代

来自分类Dev

gcc:错误:无法识别的命令行选项

来自分类Dev

C ++ 11中与std :: atomic的同步

来自分类Dev

C ++ 11 std :: thread奇怪的行为

来自分类Dev

安装以C ++编写的Python软件包(左)时出错:g ++无法识别的命令行选项--output-lib

来自分类Dev

-std = c ++ 11在g ++命令行中的位置

来自分类Dev

cc1:错误:无法识别的命令行选项'-std = c11'

来自分类Dev

make对于g ++不使用-std = c ++ 11选项

来自分类Dev

-std=c++11 在 gcc 4.8.1 上无法识别

Related 相关文章

  1. 1

    如何禁用gcc警告“ cc1:警告:命令行选项'-std = c ++ 11'对C ++ / ObjC ++有效,但对C无效(默认启用)”

  2. 2

    C ++ 11 std :: array of std :: atomic零初始化无法编译?

  3. 3

    C ++ 11嵌套std :: conditional

  4. 4

    cc1plus:错误:无法识别的命令行选项“ -std = c ++ 11”

  5. 5

    C 11 std ::线程奇怪的行为

  6. 6

    C ++ 11:错误:“开始”不是“ std”的成员

  7. 7

    将-std = c ++ 11传递给CMakeLists?

  8. 8

    无法识别的命令行选项“ -WI”

  9. 9

    在C ++ 11中从std :: deque移动元素

  10. 10

    C ++ 11 std :: thread与Windows CreateThread

  11. 11

    gcc:错误:无法识别的命令行选项“ -combine”

  12. 12

    使用nvcc / CUDA / cmake无法摆脱“警告:命令行选项'-std = c ++ 11'”

  13. 13

    makefile不适用于-std = c ++ 11选项

  14. 14

    C ++ 11:从模板函数构建std :: tuple

  15. 15

    命令行警告D9002:忽略未知选项'-std = c ++ 11'

  16. 16

    Eclipse / g ++无法识别“ -std = c ++ 11”标志

  17. 17

    cc1plus:错误:无法识别的命令行选项“ -std = c ++ 0x”

  18. 18

    C ++ 11中std :: is_base_of的逻辑

  19. 19

    播种std :: rand / c ++ 11 <random>

  20. 20

    C 11 std ::转发指针

  21. 21

    C ++ 11 std :: regex替代

  22. 22

    gcc:错误:无法识别的命令行选项

  23. 23

    C ++ 11中与std :: atomic的同步

  24. 24

    C ++ 11 std :: thread奇怪的行为

  25. 25

    安装以C ++编写的Python软件包(左)时出错:g ++无法识别的命令行选项--output-lib

  26. 26

    -std = c ++ 11在g ++命令行中的位置

  27. 27

    cc1:错误:无法识别的命令行选项'-std = c11'

  28. 28

    make对于g ++不使用-std = c ++ 11选项

  29. 29

    -std=c++11 在 gcc 4.8.1 上无法识别

热门标签

归档