Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@sources.redhat.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@sources.redhat.com>
List-Help: <mailto:cygwin-help@sources.redhat.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@sources.redhat.com
Delivered-To: mailing list cygwin@sources.redhat.com
Message-ID: <00f701c177d6$6c46f1e0$010a010a@bluesguitar.org>
From: "Matthew Smith" <matts@bluesguitar.org>
To: "Craig Sproule" <craigsproule@yahoo.com.au>
Cc: "Cygwin" <cygwin@sources.redhat.com>
References: <20011128062415.66208.qmail@web20104.mail.yahoo.com>
Subject: Re: Trouble compiling a C++ Program
Date: Wed, 28 Nov 2001 00:32:16 -0600
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


Use g++ to compile it, not gcc.

cheers,
-Matt


> To Cygwin gcc gurus,
> 
> I have downloaded the latest version of CygWin. When I
> compile the following C++ program:
> 
> ----------------------------------------
> 
> // Filename: Welcome.cpp
> // A first program in C++
> #include <iostream.h>
> 
> int main()
> {
> cout << "Welcome to C++!\n";
> 
> return 0;
> }
> 
> ----------------------------------------
> 
> gcc pops out the following error:
> 
> ----------------------------------------
> welcome.cpp: undefined reference to `cout'
> 
> welcome.cpp: undefined reference to
> `ostream::operator<<(char const *)'
> collect2: ld returned 1 exit status
> 
> ----------------------------------------
> I have been using Cygwin for a while, and have
> compiled more complex programs than this on it before.
> 
> So my question is, how do I get Cygwin to compile this
> program?
> 
> Regards
> Craig Sproule



--
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/

