From: lhall AT rfk DOT com (Larry Hall) Subject: Re: problems with String.h 8 Apr 1997 09:05:55 -0700 Approved: cygnus DOT gnu-win32 AT cygnus DOT com Distribution: cygnus Message-ID: <2.2.32.19970408131109.00924b98.cygnus.gnu-win32@ma.ultranet.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Sender: lhall AT ma DOT ultranet DOT com X-Mailer: Windows Eudora Pro Version 2.2 (32) Original-To: drs AT cs DOT wisc DOT edu, gnu-win32 AT cygnus DOT com Original-Sender: owner-gnu-win32 AT cygnus DOT com At 08:51 PM 4/7/97 -0500, DRS wrote: >Greetings, > >The following works fine under GCC on Solaris (at school) but fails >under >my gnu-win32 setup at home: > >//g++ -c str.cpp >//g++ -o str.exe str.o > >#include >#include > >main() >{ > string str("This is a test."); > cout << str << endl; > return 0; > >} > >/* >str.o(.text+0x35):str.cc: undefined reference to `String::String(char co >str.o(.text+0x4b):str.cc: undefined reference to `operator<<(ostream &, >onst &)' >str.o(.text+0x66):str.cc: undefined reference to `String::~String(void)' >*/ > >Is this simply a configuration problem, or what? I was wondering if it >had >to do with the string.h/String.h name collision. I have no problem using >iostream.h, which looks to be in the same directory. Ideas anyone? > >Thank-you in advance for your help, > >DRS >- >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". > For me, linking with -lg++ did the trick. I'm not sure why this library isn't included by default.... Larry - 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".