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: <3A87AA20.2C497E4C@ism.tu-berlin.de>
Date: Mon, 12 Feb 2001 09:17:20 +0000
From: Georg Fusz <fusz@ism.tu-berlin.de>
Organization: Techn.University Berlin
X-Mailer: Mozilla 4.76 [en] (WinNT; U)
X-Accept-Language: en
MIME-Version: 1.0
To: Anton Mochalin <bloomdido@mtu-net.ru>
CC: cygwin@cygwin.com
Subject: Re: Trying to compile a simple C++ program
References: <001201c0940b$08c8c3a0$ac07f8d4@1>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit


Use 'g++' instaedt of 'gcc'.
Both commands calls the same compiler/linker; but they use different options.


Anton Mochalin wrote:
> 
> Hello.
> 
> I typed a simple program into a file 'a.cpp':
> 
> #include <iostream.h>
> 
> main()
> {
>  cout << "Hi!";
> }
> 
> and then tried to compile it:
> $ gcc -o a.exe a.cpp
> 
> All I got is:
> 
> /c/WINDOWS/TEMP/ccnLFh81.o(.text+0x18):a.cpp: undefined reference to `cout'
> /c/WINDOWS/TEMP/ccnLFh81.o(.text+0x1d):a.cpp: undefined reference to
> `ostream::operator<<(char const *)'
> collect2: ld returned 1 exit status
> 
> What's wrong? It seems that maybe something is wrong with the header files
> (iostream.h maybe) but what should I do to make gcc compile this program?
> My cygwin version is 1.1.8-2 and gcc version is 2.95.2-7
> 
> Anton.
> 
> --
> Want to unsubscribe from this list?
> Check out: http://cygwin.com/ml/#unsubscribe-simple

-- 
Georg Fusz
Technische Universitaet Berlin, Germany


Fon:
Uni.: +49 30 314 26 884
privat: +49 30 815 30 32
Handy: +49 173 20 10 696

Homepage: http://www.cadlab.tu-berlin.de/~fusz/

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

