By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,077 Members | 1,175 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,077 IT Pros & Developers. It's quick & easy.

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

P: n/a
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.
Jul 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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

Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.