简体   繁体   English

错误:在 lambda 参数声明中使用 'auto' 仅适用于 '-std=c++14' 或 '-std=gnu++14' 和 PCL 错误

[英]error: use of ‘auto’ in lambda parameter declaration only available with ‘-std=c++14’ or ‘-std=gnu++14’ and PCL errors

I am performing calibration using link "https://github.com/lixiny/handeye-calibration-ros".我正在使用链接“https://github.com/lixiny/handeye-calibration-ros”进行校准。

When I run catkin_make under src/ Handeye-Calibration-ROS , it is giving me following error:当我在src/ Handeye-Calibration-ROS下运行catkin_make时,它​​给了我以下错误:

/usr/include/pcl-1.10/pcl/common/impl/io.hpp:272:33: error: use of ‘auto’ in lambda parameter declaration only available with ‘-std=c++14’ or ‘-std=gnu++14’

and command catkin_make end with PCL error:和命令catkin_make以 PCL 错误结束:

make[2]: *** [camera_driver/CMakeFiles/realsense2_driver.dir/build.make:76: camera_driver/CMakeFiles/realsense2_driver.dir/src/realsense2_driver.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:2053: camera_driver/CMakeFiles/realsense2_driver.dir/all] Error 2
make: *** [Makefile:146: all] Error 2
Invoking "make -j24 -l24" failed

I tried CXXFLAGS=--std=gnu++14 , still same error.我试过CXXFLAGS=--std=gnu++14 ,仍然是同样的错误。

In which file I need to change the value of C++?我需要在哪个文件中更改 C++ 的值?

According to Cmake's site , you can set the c++ standard using:根据Cmake's site ,您可以使用以下方法设置 c++ 标准:

set_property(TARGET tgt PROPERTY CXX_STANDARD 14)

If you want to modify the makefile itself, adding the c++ flag should produce a command that looks similar to:如果您想修改 makefile 本身,添加 c++ 标志应该会生成一个类似于以下内容的命令:

g++ -std=c++14(or gnu++14) main.cpp -o main

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误:在 lambda 参数声明中使用 &#39;auto&#39; 仅适用于 -std=c++1y 或 -std=gnu++1y [-Werror] - error: use of 'auto' in lambda parameter declaration only available with -std=c++1y or -std=gnu++1y [-Werror] C++:错误:无法识别的命令行选项“-std=gnu++14” - c++: error: unrecognized command line option ‘-std=gnu++14’ 在 lambda C++14 中捕获 std::promise - Capture std::promise in a lambda C++14 C ++ 14 auto lambda可以接受Obj <std::tuple<void> &gt; - 但模板功能不能? - C++14 auto lambda can accept Obj<std::tuple<void> > — but template functions cannot? C++14:具有泛型 std::function 作为类成员的泛型 lambda - C++14: Generic lambda with generic std::function as class member Qt 5.7将-std = gnu ++ 11添加到我的编译器标志中,clobbering -std = c ++ 14 - Qt 5.7 adding -std=gnu++11 to my compiler flags, clobbering -std=c++14 为什么在 C++14 中使用 std::bind 而不是 lambdas? - Why use std::bind over lambdas in C++14? c ++ 14中std :: string的运算符后缀 - operator suffix for std::string in c++14 在 C++14 中支持 std::cbegin() - Support of std::cbegin() in C++14 如何从 C++14 中的广义 lambda 捕获返回包含 std::unique_ptr 的 std::function? - How to return a std::function that contains a std::unique_ptr from a generalized lambda capture in C++14?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM