Qt World Summit: Submit your Presentation

[Solved] STL map does not seem to work in Qt for me.

  • Hi All,

    I am porting a large-ish project from Microsoft VC++ into a Qt project. For Qt, I was of the impression that all standard C++ is supported (i.e. by the standard c++ compiler).

    I have the following lines of code in one file:

    #include <map>
    map<int, int> iMap;

    When I compile it I get "map does not name a type"

    I could make this a QMap, but I don't really want to have to convert all of the STLs used in this project to Qt versions of the same thing. I really don't want to touch any of the standard c++ at all.

    Does anyone know why this would not work?
    I am using the QT SDK 5.0.2 on Windows XP at the moment.


  • Moderators

    Your compiler setup must be wrong, STL missing from includepath. The snippet you've provided is pure C++ and should work, Qt should not have anything to do with it. Perhaps you've missed "using namespace std;" in your code.

  • ooooh...yeah :o

    You are right, the using of the name space must have been in a different part of the project that I did not port over yet....

    Thanks, that solved it!

Log in to reply