Subject: Re: Gcc compiler b18 newbie probs
From: [email-masked] (Colin Peters)

9 Dec 1997 23:39:06 -0800
Message-ID: <[email-masked]>
Reply-To: "Colin Peters" <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
To: "Rich Dorfman" <[email-masked]>
Cc: "GNU-Win32" <[email-masked]>

From: Rich Dorfman <[email-masked]>
To: [email-masked] <[email-masked]>
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
"[email-masked]" with one line of text: "help".