X-Spam-Check-By: sourceware.org X-YMail-OSG: Wj_hKEIVM1k_a.mfeBr1sBAdAIPPx84Yp1m7h8Oh1Oyh6hu.sfndFE8jKaqUPfByz8JyehML4ScVd.nrKLddP9DE2chR0qigLtsUPvJP7iFVpSjfRG5pKToXgHbnNYb0eligJSf8QPWWNkAi_qqeLViDKsb.oXcFpZqt07zdI7teaC2.i8_L4BucamzL Date: Thu, 7 Dec 2006 05:01:54 -0800 (PST) From: Matthias Blaickner Subject: iostream To: cygwin AT cygwin DOT com MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <874973.68359.qm@web33010.mail.mud.yahoo.com> X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com 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: #include main() { cout << "He's not the Messiah. He's a very naughty boy" << endl; } resulting in: In file included from /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/iostream.h:31, from test.cc:1: /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 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. test.cc:5:2: warning: no newline at end of file using returns: test.cc: In function `int main()': test.cc:4: error: `cout' undeclared (first use this function) test.cc:4: error: (Each undeclared identifier is reported only once for each function it appears in.) test.cc:4: error: `endl' undeclared (first use this function) test.cc:5:2: 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 cc-suffix. thanks for any advise matthias 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 > > 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 read: The default suffixes for C++ are ".C", ".cc", and ".cxx". 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) Gareth ____________________________________________________________________________________ Cheap talk? Check out Yahoo! Messenger's low PC-to-Phone call rates. http://voice.yahoo.com -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/