This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]


Hi everybody

I have problems with cygwin supporting iostream.h I
use g++ as compiler and I'm told to remove the .h
suffix from the header. doing so results in error
messages about unknown functions.
the test programm is:

cout << "He's not the Messiah. He's a very naughty
boy" << endl;

resulting in:
In file included from
warning: #warning This file includes at least one
deprecated or antiquated header. Please consider using
one of the 32 headers found in section of the
C++ standard. Examples include substituting the 
header for the  header for C++ includes, or
 instead of the deprecated header
. To disable this warning use
-Wno-deprecated. warning: no newline at end of file

using  returns: In function `int main()': error: `cout' undeclared (first use this
function) error: (Each undeclared identifier is
reported only once for each function it appears in.) error: `endl' undeclared (first use this
function) warning: no newline at end of file

I really searched the mailing list, the web etc. the
advice below doesn't help me since I Do use g++ and a

thanks for any advise

    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
    > >
    > > 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
    > > call g++.
    > > Igor
    > Hmm, I suppose I better correct myself before
someone else does...
    > The default extensions (suffixes) for C++ are
".C", ".cc", ".cpp", and
    > ".cxx". Any suffix that is not recognized (e.g.,
".o" and ".a") is passed
    > directly to the linker.

    What's wrong with me today? :-(
    Please strike the ".cpp" suffix. The above should
    The default suffixes for C++ are ".C", ".cc", and

your 'mistake' was understandable, since ".C", ".cc",
".cxx", ".cp", ".cpp" and".c++". are all considered
c++ in gcc 3.0 and up. (although the person in this
question is obviously using <3.0 since they got it to
compile :P)


Cheap talk?
Check out Yahoo! Messenger's low PC-to-Phone call rates.

Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]