This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
Re: Gcc compiler b18 newbie probs
- To: "Rich Dorfman" <webhead at web-feats dot com>
- Subject: Re: Gcc compiler b18 newbie probs
- From: "Colin Peters" <colin at bird dot fu dot is dot saga-u dot ac dot jp>
- Date: Wed, 10 Dec 1997 16:05:23 +0900
- Cc: "GNU-Win32" <gnu-win32 at cygnus dot com>
- Reply-To: "Colin Peters" <colin at bird dot fu dot is dot saga-u dot ac dot jp>
From: Rich Dorfman <webhead@web-feats.com>
To: gnu-win32@cygnus.com <gnu-win32@cygnus.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@cygnus.com" with one line of text: "help".