This is the mail archive of the
mailing list for the Cygwin project.
Re: [ECOS] why cygwin does not support "iostream.h"?
- From: Igor Pechtchanski <pechtcha at cs dot nyu dot edu>
- To: =?X-UNKNOWN?B?5bygIOS6rg==?= <johnsonest at hotmail dot com>
- Cc: cygwin at cygwin dot com
- Date: Sat, 17 Aug 2002 08:04:04 -0400 (EDT)
- Subject: Re: [ECOS] why cygwin does not support "iostream.h"?
- Reply-to: cygwin at cygwin dot com
On 17 Aug 2002, Gary Thomas wrote:
> On Sat, 2002-08-17 at 01:03, 张 亮 wrote:
> > hi all,
> > my c++ code:
> > #include <iostream.h>
> > ...
> > cout<<value;
> > ...
> > >gcc classtest.cxx -g -o classtest.exe
> > ld error:
> > undefined reference to "cout" and operator "<<"
> > how to get iostream's support?
> This would be better asked on the CygWin list :-)
This would be better asked on the GCC list :-p
I believe this is in the gcc FAQ. However, it's been asked often enough
on this list, so here's an answer for the archives:
gcc uses the file extension to determine the language. Any extension it
doesn't recognize is assumed to be a C file. The default extension for a
C++ file is ".C". gcc does not recognize ".cxx", which is used by
Microsoft compilers, I think. It is, of course, possible to tell gcc to
treat a ".cxx" file as a C++ file. In case you don't want to mess with
the gcc configuration, use either the "-x c++" option of gcc, or simply
|\ _,,,---,,_ email@example.com
ZZZzz /,`.-'`' -. ;-;;,_ firstname.lastname@example.org
|,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski
'---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow!
It took the computational power of three Commodore 64s to fly to the moon.
It takes a 486 to run Windows 95. Something is wrong here. -- SC sig file
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html