delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/03/30/20:11:38

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-Authentication-Warning: slinky.cs.nyu.edu: pechtcha owned process doing -bs
Date: Tue, 30 Mar 2004 20:11:16 -0500 (EST)
From: Igor Pechtchanski <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: David <lingua2003 AT hotmail DOT com>
cc: cygwin AT cygwin DOT com
Subject: Re: gcc: std::cout problem
In-Reply-To: <BAY14-DAV48WwY0VnkB0000cebd@hotmail.com>
Message-ID: <Pine.GSO.4.56.0403302009470.1185@slinky.cs.nyu.edu>
References: <20040327102854 DOT 6153 DOT qmail AT web21412 DOT mail DOT yahoo DOT com> <Pine DOT GSO DOT 4 DOT 58 DOT 0403291233150 DOT 21204 AT thing1-200> <BAY14-DAV23A4NWXAgO0001b19c AT hotmail DOT com> <6 DOT 0 DOT 1 DOT 1 DOT 0 DOT 20040329143523 DOT 036a6818 AT 127 DOT 0 DOT 0 DOT 1> <BAY14-DAV39VuIvAATL0001a713 AT hotmail DOT com> <Pine DOT GSO DOT 4 DOT 56 DOT 0403292245210 DOT 1185 AT slinky DOT cs DOT nyu DOT edu> <BAY14-DAV40fN3vSAMf0000c72b AT hotmail DOT com> <6 DOT 0 DOT 1 DOT 1 DOT 0 DOT 20040330144914 DOT 03697670 AT 127 DOT 0 DOT 0 DOT 1> <BAY14-DAV48WwY0VnkB0000cebd AT hotmail DOT com>
MIME-Version: 1.0
X-Scanned-By: MIMEDefang 2.39

On Tue, 30 Mar 2004, David wrote:

> The source code was:
> -------------------------------------------------------
> #include <iostream>
>
> int main()
> {
>
> std::cout << "Hello,World!";
>
> }
>
> --------------------------------------------
>
> and from the shell:
>
> ----------------------------------------------
> $ gcc HelloWorld.cpp
> /cygdrive/c/DOCUME~1/dAvId/LOCALS~1/Temp/ccEM3ulm.o(.text+0x37):HelloWorld.cpp: undefined reference to `std::cout'
> /cygdrive/c/DOCUME~1/dAvId/LOCALS~1/Temp/ccEM3ulm.o(.text+0x3c):HelloWorld.cpp: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
> /cygdrive/c/DOCUME~1/dAvId/LOCALS~1/Temp/ccEM3ulm.o(.text+0x65):HelloWorld.cpp: undefined reference to `std::ios_base::Init::Init[in-charge]()'
> /cygdrive/c/DOCUME~1/dAvId/LOCALS~1/Temp/ccEM3ulm.o(.text+0x80):HelloWorld.cpp: undefined reference to `std::ios_base::Init::~Init [in-charge]()'
> collect2: ld returned 1 exit status
>
> Is this normal? With std::cout error?
> I mean, is this from the source code itself?
> To me, the source looks fine, though.
>
> Thank you in advance.
> David

(a) Use 'g++' to link C++ code.
(b) Please start a new thread when switching topics, rather than
continuing old threads.
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha AT cs DOT nyu DOT edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor AT watson DOT ibm DOT com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster."  -- Patrick Naughton

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019