That's an old version of GCC (current version is 4.8.2).
std::prev() is a feature of C++11 (the C++ standard of 2011).
Your compiler, being too old, does not implement it.
I realize this is an un-solution, but if you don't need to use std::prev() then don't use it.
Your for() loop leaves out the last element in the map, is this really what you want?
Otherwise upgrade your compiler to a more recent version.
Features of C++11 are marked in the documentation.
See again the page for std::prev() and look for the C++11 Warning icon.
(Little C++11 icons appear in the menu on the left as well, where needed.)
Today I tried with latest gcc but still no luck...
test3.cpp: In function ‘int main()’:
test3.cpp:13:79: error: ‘prev’ was not declared in this scope
for (map<int,int>::iterator it = testMap.begin(); it != prev(testMap.end()); it++) {
^
risestoke-lm:CppCheney qili$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-apple-darwin12.4.0/4.9.0/lto-wrapper
Target: x86_64-apple-darwin12.4.0
Configured with: ../gcc-4.9-20130811/configure --enable-languages=fortran,c++
Thread model: posix
gcc version 4.9.0 20130811 (experimental) (GCC)