compilation errors in VC++ with map, but works fine in linux

Discussion in 'C++' started by murali, Jun 25, 2003.

  1. murali

    murali Guest

    map<float,int> m;
    typedef map<float,int>::const_iterator iter;

    This declaration works fine in linux and the program also runs fine.

    But in VC++:

    error C2653: 'map<float,int,struct std::less<float>,class
    std::allocator<int> >' : is not a class or namespace name.

    Can anyone throw light how to fix this error.

    Thanks,
    Murali.
    murali, Jun 25, 2003
    #1
    1. Advertising

  2. murali

    Phlip Guest

    murali wrote:

    > But in VC++:
    >
    > error C2653: 'map<float,int,struct std::less<float>,class
    > std::allocator<int> >' : is not a class or namespace name.


    typedef std::map<float,int>::const_iterator iter;

    g++ is too forgiving (which sometimes means "sloppy").

    --
    Phlip
    http://www.c2.com/cgi/wiki?TestFirstUserInterfaces
    Phlip, Jun 25, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Adam P
    Replies:
    0
    Views:
    473
    Adam P
    Sep 27, 2005
  2. flxkid
    Replies:
    1
    Views:
    895
    flxkid
    Sep 18, 2009
  3. ian douglas
    Replies:
    5
    Views:
    174
    88888 Dihedral
    Mar 5, 2013
  4. Wolfgang Strobl
    Replies:
    0
    Views:
    134
    Wolfgang Strobl
    Mar 4, 2013
  5. Terry Reedy
    Replies:
    0
    Views:
    144
    Terry Reedy
    Mar 4, 2013
Loading...

Share This Page