From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20402 invoked by alias); 28 Nov 2001 08:47:20 -0000 Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@sources.redhat.com Received: (qmail 20380 invoked from network); 28 Nov 2001 08:47:20 -0000 Received: from unknown (HELO hotmail.com) (216.33.236.57) by hostedprojects.ges.redhat.com with SMTP; 28 Nov 2001 08:47:20 -0000 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Wed, 28 Nov 2001 00:47:19 -0800 X-Originating-IP: [198.142.199.187] From: "Gareth Pearce" To: , "Craig Sproule" References: <20011128062415.66208.qmail@web20104.mail.yahoo.com> <117301454478.20011128092612@familiehaase.de> Subject: Re: Trouble compiling a C++ Program Date: Sun, 18 Nov 2001 10:21:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Message-ID: X-OriginalArrivalTime: 28 Nov 2001 08:47:19.0920 (UTC) FILETIME=[4A35A700:01C177E9] X-SW-Source: 2001-11/txt/msg01129.txt.bz2 > Hallo Craig, > > Am 2001-11-28 um 07:24 schriebst du: > > > I have downloaded the latest version of CygWin. When I > > compile the following C++ program: > > > // Filename: Welcome.cpp > > // A first program in C++ > > #include > > > int main() > > { > > cout << "Welcome to C++!\n"; > > > return 0; > > } > > > gcc pops out the following error: > > > welcome.cpp: undefined reference to `cout' > > > So my question is, how do I get Cygwin to compile this > > program? > > $ g++ -o hello2 hello2.cc > > $ hello2 > Welcome to C++! > > I remember that if you use the extension .cc, gcc calls g++ > automagically, but it doesn't work. which is i believe because g++ invoked directly has an implied -lstdc++ if you do gcc -lstdc++ it will also compile just fine. Ofcourse g++ is probably a better move for some reason... (other then reduced typing) > > Ciao, > > Gerrit P. Haase mailto:gp@familiehaase.de > -- > =^..^= > > > -- > Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple > Bug reporting: http://cygwin.com/bugs.html > Documentation: http://cygwin.com/docs.html > FAQ: http://cygwin.com/faq/ > > -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/ From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Gareth Pearce" To: , "Craig Sproule" Subject: Re: Trouble compiling a C++ Program Date: Wed, 28 Nov 2001 00:47:00 -0000 Message-ID: References: <20011128062415.66208.qmail@web20104.mail.yahoo.com> <117301454478.20011128092612@familiehaase.de> X-SW-Source: 2001-11/msg01717.html Message-ID: <20011128004700.EcKRsoW8-aT6EpMzPquqjlP3oGjHe5dlxtn3ZjzNRTw@z> > Hallo Craig, > > Am 2001-11-28 um 07:24 schriebst du: > > > I have downloaded the latest version of CygWin. When I > > compile the following C++ program: > > > // Filename: Welcome.cpp > > // A first program in C++ > > #include > > > int main() > > { > > cout << "Welcome to C++!\n"; > > > return 0; > > } > > > gcc pops out the following error: > > > welcome.cpp: undefined reference to `cout' > > > So my question is, how do I get Cygwin to compile this > > program? > > $ g++ -o hello2 hello2.cc > > $ hello2 > Welcome to C++! > > I remember that if you use the extension .cc, gcc calls g++ > automagically, but it doesn't work. which is i believe because g++ invoked directly has an implied -lstdc++ if you do gcc -lstdc++ it will also compile just fine. Ofcourse g++ is probably a better move for some reason... (other then reduced typing) > > Ciao, > > Gerrit P. Haase mailto:gp@familiehaase.de > -- > =^..^= > > > -- > Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple > Bug reporting: http://cygwin.com/bugs.html > Documentation: http://cygwin.com/docs.html > FAQ: http://cygwin.com/faq/ > > -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/