2

I am trying to install Cling(interactive C++ interpreter) from here using the .sh file. While I run the .sh file in the terminal, I get the following errors:

cc1plus: error: unrecognized command line option ‘-std=c++11’

Since the default gcc for 12.04 is 4.6.3, I updated to gcc 4.8 to help remove C++11 errors, then ran the following commands to check which version of gcc is being used for compilation

gcc --version
gcc (Ubuntu 4.8.1-2ubuntu1~12.04) 4.8.1
Copyright (C) 2013 Free Software Foundation, Inc.

I also tried to figure out the current priorities of gcc, as mentioned here,

update-alternatives --query gcc
Link: gcc
Status: auto
Best: /usr/bin/gcc-4.8
Value: /usr/bin/gcc-4.8

Alternative: /usr/bin/gcc-4.8
Priority: 50

But the "cc1plus" error still remains. Is there a way to resolve this to help me run Cling seamlessly? Thanks!


EDIT: Followed this and also updated my g++ from default 4.6.3 to 4.8.1 and the dont see the C++11 error anymore.

Community
  • 1
  • 1
Luminosity
  • 31
  • 1
  • 5
  • To verify, you did run the configure option before running the make? They list it as: `./configure --enable-cxx11` – dtmland Feb 17 '15 at 06:32
  • Could you please elaborate a bit on how to configure gcc for c++11? And should I also update my g++(4.6.3) to the latest version? – Luminosity Feb 17 '15 at 06:46
  • did you try compiling simple c++11 code using:- g++ -std=c++11 sample.cpp from the terminal? – Shivaraj Bhat Feb 17 '15 at 06:56
  • @ShivarajBhat -No, this error appeared when I ran the Cling shell script from the terminal. – Luminosity Feb 17 '15 at 07:15
  • Check the version of `g++` not `gcc`. – Mike Seymour Feb 17 '15 at 08:18
  • Thanks @MikeSeymour, I have updated gcc to 4.8.1 and the C++11 error seems to be resolved. But I get a makeall error now. Please see Edited question. – Luminosity Feb 17 '15 at 08:40
  • @Luminosity There's almost always an actually useful error message from the command that failed before "Error 2". Aside from that, it seems to be a completely different question from what you originally asked, and editing questions like that is generally not accepted here. –  Feb 17 '15 at 09:13

0 Answers0