Rate This Document
Findability
Accuracy
Completeness
Readability

Error std::unique_ptr Reported During CMake Compilation

Symptom

Error std::unique_ptr is reported during CMake compilation, and the error message "CMake Error at CMakeLists.txt:92 (message): The C++ compiler does not support C++11 (e.g. std::unique_ptr)" is displayed.

Key Process and Cause Analysis

This error is related to the system time setting.

Conclusion and Solution

After the system time is set correctly, decompress the source code package again for compilation.

Or

Modify the CmakeCache.txt file.
  1. Open the CmakeCache.txt file.

    vi CmakeCache.txt

  2. Press i to enter the insert mode and modify line 362 in the CmakeCache.txt file.
    CMake_HAVE_CXX_UNIQUE_PTR:INTERNAL=ON
  3. Press Esc, type :wq!, and press Enter to save the settings and exit.
  4. Perform compilation and installation.

    make