I currently use C++ string properties and specifically its pop_back() fonction. As written in the title, it leads to an error (same error seen ini an other topic) :

‘std::string’ has no member named ‘pop_back’

But what's strange is that I already use C++11 specific properties (as "auto" for iterators, etc.) and I never get any error.

For information, I build my code under Ubuntu 12.04 with gcc 4.6.3. For me, this version is good enough. I also put "-std=c++0x" flag so I really don't know where is the point ?!

Moreover, I've seen, in previous topic, that it's better to use "-std=c++11" flag now. But when I try this, the following error appears :

unrecognized command line option ‘-std=c++11’
有帮助吗?

解决方案

On gcc 4.6 (which had only partial support for the new standard) the option is -std=c++0x because at that time the release date (i.e., 2011) was still unknown.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top