This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
Re: Trouble compiling a C++ Program
- From: "Gerrit P. Haase" <gp at familiehaase dot de>
- To: Craig Sproule <craigsproule at yahoo dot com dot au>
- Cc: cygwin at cygwin dot com
- Date: Wed, 28 Nov 2001 09:26:12 +0100
- Subject: Re: Trouble compiling a C++ Program
- Organization: Esse keine toten Tiere
- References: <20011128062415.66208.qmail@web20104.mail.yahoo.com>
- Reply-to: "Gerrit P. Haase" <cygwin at cygwin dot com>
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 <iostream.h>
> 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.
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/