7

I try to build the fblualib. However, when running build.sh I get the following error:

-- Found Folly: /usr/local/include  
-- Found Torch7 in /home/dmus/torch/install
-- Found Folly: /usr/local/include  
-- Configuring done
-- Generating done
-- Build files have been written to: /home/dmus/fblualib/fblualib/build
[ 25%] Building CXX object CMakeFiles/fblualib.dir/LuaUtils.cpp.o
c++: error: unrecognized command line option ‘-std=gnu++14’
make[2]: *** [CMakeFiles/fblualib.dir/LuaUtils.cpp.o] Error 1
make[1]: *** [CMakeFiles/fblualib.dir/all] Error 2
make: *** [all] Error 2

g++ --version outputs g++ (Ubuntu 4.8.4-2ubuntu1~14.04.1) 4.8.4. I see related questions, however I do not see how to fix this.

Derk
  • 1,385
  • 3
  • 19
  • 38
  • 2
    Your compiler is too old. – Baum mit Augen Oct 05 '16 at 10:09
  • See [here](https://gcc.gnu.org/projects/cxx-status.html) for a complete list of g++ versions and supported standards. BTW, it is a pain to develop with an outdated tool chain. If there is _any_ possible way to get onto an up to date Linux distribution, try that first. –  Oct 05 '16 at 10:11
  • 1
    Note: After an upgrade (g++5) you should prefer `-std=c++14` –  Oct 05 '16 at 10:13
  • From the same link: "it can be explicitly selected with the -std=c++14 command-line flag, or -std=gnu++14 to enable GNU extensions as well." Why exactly you get a configuration that needs -std=gnu++14 is up to the maintainers of the library you are trying to install. –  Oct 05 '16 at 10:16
  • resolved by [How to Install gcc 5.3 with yum on CentOS 7.2?](https://stackoverflow.com/questions/36327805/how-to-install-gcc-5-3-with-yum-on-centos-7-2) – phxism Dec 11 '21 at 15:03

1 Answers1

9

You need to upgrade your g++ (At least to version 4.9.*).

Once upgrade is done, try compiling using g++ -std=c++14 file.cpp or g++ -std=c++1y file.cpp.

Shravan40
  • 8,922
  • 6
  • 28
  • 48