Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   C++ (http://www.velocityreviews.com/forums/f39-c.html)
-   -   compilation errors in VC++ with map, but works fine in linux (http://www.velocityreviews.com/forums/t267686-compilation-errors-in-vc-with-map-but-works-fine-in-linux.html)

murali 06-25-2003 05:49 AM

compilation errors in VC++ with map, but works fine in linux
 
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.

Phlip 06-25-2003 05:58 AM

Re: compilation errors in VC++ with map, but works fine in linux
 
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





All times are GMT. The time now is 07:04 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.