Mail Archives: cygwin/1997/12/09/23:39:06
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 -