Clearly you didn't even take the trouble to read the warnings g++ emitted immediately before that error message. If you had, you would have seen that g++ explained the reason for the error.

g++ is not configured by default to support C++11. The offending line uses a lambda, which is C++-11 specific. Read the documentation for the necessary command line options to compile with C++11 support (at least, as far as g++ supports C++11).

Also, line 52 will not compile with any version of C++, nor with any compiler.

Right 98% of the time, and don't care about the other 3%.

If I seem grumpy or unhelpful in reply to you, or tell you you need to demonstrate more effort before you can expect help, it is likely you deserve it. Suck it up, Buttercup, and read this, this, and this before posting again.

g++ is configured by default to emit that warning message, not configured to support C++-11.

Right 98% of the time, and don't care about the other 3%.

If I seem grumpy or unhelpful in reply to you, or tell you you need to demonstrate more effort before you can expect help, it is likely you deserve it. Suck it up, Buttercup, and read this, this, and this before posting again.

Regarding flags: for starters, try -std=c++11. That should enable lambdas.

dwk

Seek and ye shall find. quaere et invenies.

"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell

Good point. Error messages are coming from "/usr/include/c++/4.6/" in the original post. Didn't notice.

dwk

Seek and ye shall find. quaere et invenies.

"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell