delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/12/09/23:39:06

From: colin AT bird DOT fu DOT is DOT saga-u DOT ac DOT jp (Colin Peters)
Subject: Re: Gcc compiler b18 newbie probs
9 Dec 1997 23:39:06 -0800 :
Message-ID: <01bd0539$fbf8c020$fa173185.cygnus.gnu-win32@gbird0.fu.is.saga-u.ac.jp>
Reply-To: "Colin Peters" <colin AT bird DOT fu DOT is DOT saga-u DOT ac DOT jp>
Mime-Version: 1.0
To: "Rich Dorfman" <webhead AT web-feats DOT com>
Cc: "GNU-Win32" <gnu-win32 AT cygnus DOT com>

From: Rich Dorfman <webhead AT web-feats DOT com>
To: gnu-win32 AT cygnus DOT com <gnu-win32 AT cygnus DOT com>
Date: Wednesday, December 10, 1997 3:43 PM


>Just installed Gnu-Win32 b18 on Win95 P100 platform. Paths and
environment
>variables successfully added to autoexec.bat.
>
>Tried to compile the following:
>
>#include <iostream.h>
>int main(void)
>{ 
> cout << "Come up and C++ me some time."; 
> cout << "\n";
> return 0;
>}
>
>Got the following errors:
>
>undefined reference to `cout'
>undefined reference to `ostream::operator<<(char const *)'
>
>I presume that iostream.h is not being found. The file resides at:
> C:\gnuwin32\b18\include\g++\iostream.h

The problem is not iostream.h not being found. Note that the linker (not the compiler) is complaining, and it knows about ostream, which it wouldn't if it wasn't reading the headers. The problem is that the iostream library is not being linked. Try adding -lstdc++ on your link line (or using g++ instead of gcc to do your linking).

Good luck,
Colin.

-- Colin Peters -- colin at fu.is.saga-u.ac.jp
-- Saga University Dept. of Information Science
-- http://www.fu.is.saga-u.ac.jp/~colin
-- http://www.geocities.com/Tokyo/Towers/6162



-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


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