Problems with gcc 2.95.3 / stdc++ 2.90.8

Neil Bird neil@fnxweb.com
Wed Dec 19 03:41:00 GMT 2001


   ... undefined reference to `cout'


   <sigh>  I'm getting nowhere, so I'm afraid I'll have to ask here:

   I need to prove the use of the C++ STL using gcc 2.95.3.  I 
initially tried under Solaris, and *almost* got there, but with 
my dicky setup I ended up with a g++ that gave loads of wchar 
template errors.

   So, I've moved closer to the intended target by trying under 
Cygwin.  I got Cygwin's 2.95.3, put in libstdc++ 2.90.8 (the 
associated patch seems to already have been done in the Cygwin 
sources).


   All compiles fine, and with a minor tweak (Cygwin have 
hardcoded /usr/include/g++-3 where my install is 
/usr/local/include/g++-v3) I can run g++.  Mostly.  I simple 
std::cout << "Hello world\n" program gives me:

/tmp/ccAz4QzY.o(.text+0x28):jibby.cc: undefined reference to `cout'
/tmp/ccAz4QzY.o(.text+0x2d):jibby.cc: undefined reference to 
`basic_ostream<char, char_traits<char> > & 
operator<<<char_traits<char> >(basic_ostream<char, 
char_traits<char> > &, char const *)'
/tmp/ccAz4QzY.o(.text+0x62):jibby.cc: undefined reference to 
`ios_base::Init::Init(void)'
/tmp/ccAz4QzY.o(.text+0x7b):jibby.cc: undefined reference to 
`ios_base::Init::~Init(void)'
collect2: ld returned 1 exit status


   (full -v output attached).  I got /just/ the first two 
undefined refs. initially when my g++ was erroneously picking up 
the old include/g++-3 iostream file.

   The Init errors  I've seen before on Solaris when 
accidentally using 'gcc' instead of 'g++'.


   I've tried -lstdc++ and even including the libstdc++.a full 
pathname, with no change in the outcome (match, looking at the 
-v output).

   Any ideas?  What's my next investigative step?

-- 
[neil@fnx ~]# rm -f .signature
[neil@fnx ~]# ls -l .signature
ls: .signature: No such file or directory
[neil@fnx ~]# exit
.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: g++.out
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20011219/8a1132a4/attachment.ksh>


More information about the Libstdc++ mailing list