This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

C++ link problem on Windows 95 - 17.1 & 18



     I am having problems compiling C++ programs with versions 17.1 and 18
     on Windows 95.  I have tried this on two systems with beta 18 the same
     results, and on one system I tried it with both 18 and 17.1.

     I am trying to use beta 18 to learn C++, so please excuse any
     terminology problems.

     Is anyone using beta 18 to compile C++ on Windows 95?

     The results:

     C:\>gcc hello.cc
     C:\tmp/cc0010001.o(.text+0x1e):hello.cc: undefined reference to `cout'
     C:\tmp/cc0010001.o(.text+0x23):hello.cc: undefined reference to
     `ostream::operator<<(char const *)'


     I suspect that this is a linking issue, because if I execute:
         gcc -c hello.cc

     I get no error messages, and an object file is created (hello.o).

     The program:

     #include <iostream.h>

     void main ()
     {
         cout << "Hello world!\n";
     }

     Additional information...

     I have tried playing with all of the environment settings including
     LIBRARY_PATH and nothing seems to work.  I am able to compile a C
     hello.c program using printf without any problems.

     When I try to copy libg++.a to play around, I need to put the file
     name in quotes, or the copy fails, so I think there is a possibilitty
     that this may be a contributor to the problem.

     I have tried linking the hello.o module with ld, but I can not seem to
     successfully use the -l parameter to specify libg++.a

     Any help will be greatly appreciated.

     ... Darwin

     PS - I have checked the FAQ and the mailing list archive which showed
     a few others having this problem, but no solution posted.
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]