软件配置——C++ make error: 'unique_ptr' in namespace 'std' does not name a template type

背景

Ubuntu16.04
使用cmake编译安装libfreenect的时候
make -j4报错

In file included from /home/c/libfreenect/wrappers/cpp/cppview.cpp:27:0:
/home/c/libfreenect/wrappers/cpp/libfreenect.hpp:184:8: error: ‘unique_ptr’ in namespace ‘std’ does not name a template type
   std::unique_ptr<uint8_t[]> m_rgb_buffer;

报错原因

这是c++11标准,需要在CmakeLists.txt中指明

解决方法

在CmakeLists.txt中添加一行

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

你可能感兴趣的:(Ubuntu环境配置)