You're trying to use language features from 2011 with a compiler from 1997. That's not going to work.
You might have more success if you stick to C++98; although since your compiler predates even that, there's no guarantee that this would work.
// Define a comparison functor, to replace the lambda.
// This must be defined outside a function, for arcane reasons.
struct comparator {
bool operator()(const vector<float>& a, const vector<float>& b) {
return a[1] < b[1];
}
};
vector< vector<float> > my_vector ;
// Use an old-school for loop; range-based loops didn't exist back then,
// and neither did "auto" type deduction.
// (This assumes arrayCosts is also a vector<vector<float>>;
// change the iterator type if it's something else).
for (vector< vector<float> >::const_iterator it = arrayCosts.begin();
it != arrayCosts.end(); ++it)
{
// std::begin and std::end didn't exist either
my_vector.push_back( vector<float>( it->begin(), it->end() ) ) ;
}
// Again, no std::begin or std::end.
sort(my_vector.begin(), my_vector.end(), comparator());