我是一名初学者,在安装 PCL v1.8 时遇到了一些问题。
我按照这个问题的说明进行操作: 如何在 Ubuntu 16.04.2 [LTS] 上为 C++ 安装点云库 v1.8 (pcl-1.8.0)?。
pcl
当我尝试使用以下命令构建库时,我遇到了以下与编译器相关的问题:
cd pcl-pcl-1.8.0 && mkdir build && cd build
cmake ..
make
sudo make install
终端输出:
[ 5%] Built target pcl_common
[ 5%] Built target pcl_octree
[ 5%] Built target pcl_io_ply
[ 5%] Building CXX object io/CMakeFiles/pcl_io.dir/src/ensenso_grabber.cpp.o
In file included from /opt/ensenso/development/c/include/nxLib.h:25:0,
from /path/to/Downloads/pcl-pcl-1.8.0/io/include/pcl/io/ensenso_grabber.h:56,
from /path/to//Downloads/pcl-pcl-1.8.0/io/src/ensenso_grabber.cpp:40:
/opt/ensenso/development/c/include/nxLibFunctions.h:118:5: error: #error Your compiler does not support C++11. If you want to use the NxLib without C++11 features, you can define NXLIB_CPP_COMPATIBILITY_MODE before including the NxLib headers. See the manual for more information and problems this might cause.
# error Your compiler does not support C++11.
输出:gcc --version
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609
答案1
这解决了我的问题。抱歉回复晚了。手动为 gcc5 启用 cpp 11。使用
cmake -D CMAKE_CXX_STANDARD 11 ..
代替
cmake ..