3

I am currently in the process of compiling graph-tool v1.13 from the Git version. I have managed to generate the configure file from autogen.sh but am now running into trouble.

Running ./configure I receive the message:

checking whether g++ supports C++14 features by default... no
checking whether g++ supports C++14 features with -std=gnu++14... no
checking whether g++ supports C++14 features with -std=gnu++0x... no
configure: error: *** A compiler with support for C++14 language features is required.

I have checked gcc -v and g++ -v and receive the response gcc version 4.9.3 (Ubuntu 4.9.3-8ubuntu2~14.04). To my knowledge this should support C++14 so where am I going wrong? I am running Ubuntu 14.04.

P-M
  • 1,279
  • 2
  • 21
  • 35
  • Just install a newer version of [GCC](http://gcc.gnu.org/) perhaps by compiling GCC 5.3 (the latest version of GCC in febr.2016) from its source code. – Basile Starynkevitch Mar 01 '16 at 13:05
  • Installing GCC 5.x would probably work, agreed, but I wonder why the current version does not work when it looks to me like it should... – P-M Mar 01 '16 at 13:53
  • Because GCC 4.9 was released in april 2014 before the C++14 standard finalization... (so the support for a not yet released standard is experimental). You should upgrade to GCC 5 – Basile Starynkevitch Mar 01 '16 at 13:55
  • I have installed them using `sudo apt-get install gcc-5 g++-5` but `gcc -v` still returns `gcc version 4.9.3 (Ubuntu 4.9.3-8ubuntu2~14.04)`. What am I missing? – P-M Mar 01 '16 at 14:30
  • The flag may be `c++1y` or `gnu++1y` for GCC 4.9 – melak47 Mar 01 '16 at 15:45
  • `gcc-5` and `g++-5` may have been installed under exactly those names, leaving your system compiler GCC 4.9. – melak47 Mar 01 '16 at 15:47

2 Answers2

5

Try perhaps

./configure CXX='g++-5'

after having installed some GCC 5

Basile Starynkevitch
  • 223,805
  • 18
  • 296
  • 547
  • 2
    @P-M: `configure` would mean "the command `configure` found in the command path" -- which does not exist, leading to the error message you mentioned. `./configure` means "the command `configure` *in the current directory*"... – DevSolar Mar 01 '16 at 15:05
2

gcc 4.9.3 supports C++14, but the correct compiler flag is '-std=c++14'

cassini
  • 85
  • 5