This is the mail archive of the mailing list for the Cygwin project. See the Cygwin home page for more information.
Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

No Subject

I am having problems compiling C++ programs with b20.1 on Windows 95 sr2. 
Since I am trying to use cygwin to learn C++ and unix style tools both, I 
don't have a good handle on the relevant terminology, but here it is.

I can't compile a simple "hello world" program. Here it is:

     #include  <iostream>

     int main()
       std::cout << "Hello world!\n";

I get an error like this (sorry for the long line):

-o hello.exe -s
hello.o -lgcc -lcygwin -lkernel32 -ladvapi32 -lshell32 -lgcc
hello.o(.text+0x1e) undefined reference to `cout'
hello.o(.text+0x23) undefined reference to `ostream::operator<<(char
const *)'
collect2: ld returned 1 exit status
make: *** [hello.exe] Error 1

Incidently I have no problem compiling a 'c'  version of "hello world". It
seems like the problem has to do with linking to the c++  libraries, but I'm
not sure where the problem might be in my installation. When I installed
cygwin I accepted the default install directory. Also, the same error occurs
whether I  use gcc from the command line, or use a trivial make file. I can't
imagine that this should cause a problem, but I do have a version of djgpp
installed on my system (poverty of imagination?). 

In any event, all help will be very much appreciated.

-Dave Braze

Get your own FREE, personal Netscape WebMail account today at

Want to unsubscribe from this list?
Send a message to