compilator Ubuntu

What compilator should I install for the most new standards of C++ programming.
Now I have the new version g++ installed by command: sudo apt-get install g++,
but it doesn't work for example in the case of "auto" in the "lambda function"
closed account (Dy7SLyTq)
a) its compiler not compilator
b) the repository for g++ on ubuntu gives you 4.6. you need to download the source for 4.8 and build that
^
Use g++-4.8 instead.
Thank you for your helps. But I'm starting person with Linux. So could you write mi how can I do it by the console? Thank you in advance.
sudo apt-get install g++-4.8
I did it. But a got a communicate that didn't find packet g++-4.8.
Try with the following:

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install g++-4.8


If you get an error with add-apt-repository, then do this before:

sudo apt-get install software-properties-common
I did such like you had written.

But when I try to compile I get:

https://www.dropbox.com/s/vdw7j7yroexvy5m/Screenshot%20from%202013-11-09%2010%3A19%3A56.png
closed account (Dy7SLyTq)
my bad i didnt know that you could specify version number
closed account (Dy7SLyTq)
well that looks like the 4.8 compiler. the errors looks like problems with your code
Well it's clear, you cannot assign a lambda to a function pointer.
A lambda can only be stored in an auto variable or as a function template parameter.
(Also as a class template parameter with declspec).

But every lambda, even with the same inputs and outputs, has a uniquely generated type.

About the rest, you're maybe using the wrong compiler?
I'm not sure how to force G++4.8 tho
Last edited on
closed account (Dy7SLyTq)
I'm not sure how to force G++4.8 tho

absolute/relative paths? thats what i have to do with my build.
Last edited on
Its not problem with code (its such seems to me), but with the compiler.
I can take here the code and you will can see it. But mayby Somebody have any idea what should I do?
Try to compile the following:

1
2
3
4
5
int main()
{
    [](){}();
    return 0;
}


If it works, the problem is in your code.
If it doesn't, the problem is in the compiler.
Thank you very much. Now everythink is OK ;)
Topic archived. No new replies allowed.