---
title: 编译CMAKE时报The std::unique_ptr错误
description: "编译CMAKE时报The std::unique_ptr错误，报错信息“CMake Error at CMakeLists.txt:92 (message): The C++ compiler does not support C++11 (e.g. std::unique_ptr).”。"
url: https://www.hikunpeng.com/document/detail/zh/kunpenghpcs/hpcindapp/trouble/bootkit_hpc_troublecase_0051.html
sourcePath: /source/zh/kunpenghpcs/hpcindapp/trouble/bootkit_hpc_troublecase_0051.html
indexId: 13e7ccb4567e23f0cea9b75421a27e10e7854ff8ab3aef430c054851c5823d8974
---
# 编译CMAKE时报The std::unique_ptr错误

#### 问题现象描述

编译CMAKE时报The std::unique_ptr错误，报错信息“CMake Error at CMakeLists.txt:92 (message): The C++ compiler does not support C++11 (e.g. std::unique_ptr).”。


#### 关键过程、根本原因分析

此错误跟系统时间设置相关。


#### 结论、解决方案及效果

正确设定系统时间后，重新解压源码包进行编译。

或者

执行以下命令修改“CmakeCache.txt”文件。1. 打开“CmakeCache.txt”文件。
  vi CmakeCache.txt

2. 按“i”进入编辑模式，修改“CmakeCache.txt”文件的第362行。

```
CMake_HAVE_CXX_UNIQUE_PTR:INTERNAL=ON
```


3. 按“Esc”键，输入:wq!，按“Enter”保存并退出编辑。
4. 再进行编译安装。
  make
