Subject: C++ link problem on Windows 95 - 17.1 & 18
From: [email-masked]

31 Aug 1997 02:41:44 -0700
Approved: [email-masked]
Distribution: cygnus
Message-ID: <0033000004089002000004*.cygnus.gnu-win32@MHS>
Original-To: "gnu-win32(a)cygnus.com" <[email-masked]>
Original-Sender: [email-masked]

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