c++11 std::unique_ptr error cmake 3.11.3 bootstrap
Actually the ./bootstrap
script does try the different C++ standard flags with the compiler. So it should detect its capabilities automatically.
Please make sure you don't have any CXXFLAGS
environment variable set and try from scratch again (the messages/warnings you get indicate several tries/errors in the same directory).
Output when Successful
As a reference on my Ubuntu calling CMake's ./bootstrap
looks like this:
---------------------------------------------
CMake 3.11.20180423, Copyright 2000-2018 Kitware, Inc. and Contributors
Warning: This is an in-source build
Found GNU toolchain
C compiler on this system is: gcc
C++ compiler on this system is: g++ -std=gnu++1y
Makefile processor on this system is: make
g++ has setenv
g++ has unsetenv
g++ does not have environ in stdlib.h
g++ has stl wstring
g++ has <ext/stdio_filebuf.h>
---------------------------------------------
Debugging
For debugging your problem you also could:
- Call
./bootstrap --verbose
- Look into
Bootstrap.cmk/cmake_bootstrap.log
Known Problem
I only once had a problem with bootstrap
using clang
compilers where I needed to do the following call:
export CXXFLAGS=-Xclang -std=c++1z -Xclang -stdlib=libc++
Alternative
If you just want to install the latest version see How to specify where CMake is installed in Ubuntu?
cmake configure error in 3.10.1 but not in 3.9.6
Since v3.10 onwards CMake is implemented in C++11:
Deprecated and Removed Features
Support for building CMake itself with C++98 compilers was dropped. CMake is now implemented using C++11.
This requires a capable compiler. The first version of GCC which is C++11 feature complete is GCC 4.8.1.
Gcc 4.4.5 is over 7 years old and more important, it doesn't support C++11 (from the error):
Cannot find a C++ compiler supporting C++11 on this system.
Compiler update
As noted above, you need at least GCC 4.8.1. Here are some guides:
- https://gcc.gnu.org/wiki/InstallingGCC
- Installing gcc 4.8 on Debian
- https://unix.stackexchange.com/questions/112157/how-can-i-install-more-recent-versions-of-software-than-what-debian-provides
- https://nosemaj.org/debian-gcc-4-7
Error when enabling more warnings in CMake
As Stepthen Newell correctly pointed out in the comments, target_compile_definitions() adds compiler definitions, so replacing target_compile_definitions()
with target_compile_options()
does the trick, derp.
Related Topics
Bash Script - Auto Fill Answer
Converting Date with Timezone in Unix Timestamp Shell/Bash
Find Is Returning "Find: .: Permission Denied", But I Am Not Searching In
Mod_Perl Can't See Files in /Tmp
Shell Bash Script to Print Numbers in Ascending Order
Interpreting Openssl Speed Output for Rsa with Multi Option
Sysfs Interface. I Can't Export Gpio Pins in a Xilinx's Board (Zybo and Other)
X11 Forwarding Through Google Colab
Munin Dynamic Graph Zoom (Dynazoom) Not Working (Centos6,Nginx,PHP-Fpm)
Alpine Linux: Pmap Output Not Showing Rss
Kernel Oops Page Fault Error Codes for Arm
Converting Linux Svn Repos to Windows Svn Repos
Detect If Something Is Modified in Directory, and If So, Backup - Otherwise Do Nothing