ソフトウェア構成-C++make error:'unique_ptr' in namespace 'std' does not name a template type

949 ワード

背景
Ubuntu16.04 cmakeコンパイルでlibfreenectをインストールするときmake-j 4エラー
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")