Error: stable_sort identifier not found

Help
stlguy
2007-04-06
2013-05-13
  • stlguy
    stlguy
    2007-04-06

    I am using MSVC 8 on Windows and have successfully built STLPort.

    However when trying to compile my program I am getting "Identifier not found" errors for my calls to stable_sort, sort, and transform.

    Here is an example:

    This code:

       using namespace std;

       stable_sort(myVector.begin(), myVector.end(), my_sort_func());

    Causes this error:

    Error    62    error C3861: 'stable_sort': identifier not found    d:\test\test.cpp    53   
    ------

    Similarly calls to other functions like transform do the same thing.  For instance:

       transform(myString.begin(), myString.end(), myString.begin(), tolower);   

    causes this:

    Error    44    error C3861: 'transform': identifier not found    d:\test\test.cpp    5779   
    -------

    What am I doing wrong here?  How can this be fixed? Thank you very much!

     
    • stlguy
      stlguy
      2007-04-06

      Please disregard this - I figured it out. I was missing a #include <algorithm>.  Thank you.