egcs-1.0.2: string<unsigned char> failure

Munagala V. S. Ramanath ram@netcom.com
Thu Apr 30 16:33:00 GMT 1998


The following trivial program produces "undefined symbol" loader
diagnostics as well as assorted warnings:

-----  CUT HERE  --------------------------------------  CUT HERE  -----
// test strings of unsigned chars
//
#include <fstream.h>
#include <string>

typedef basic_string<unsigned char> ustring ;

int
main()
{
    unsigned char p[] = { 'a', 'b', 'c' } ;
    ustring s( p, 3 ) ;
    cout << "s.size() = " << s.size() << endl ;
    return 0 ;
}
-----  CUT HERE  --------------------------------------  CUT HERE  -----

Version/platfrom info:
g++ -v
Reading specs from /d2a/exper/lib/gcc-lib/sparc-sun-sunos4.1.2/egcs-2.90.27/specs
gcc version egcs-2.90.27 980315 (egcs-1.0.2 release)

Here is the attempted compile:
g++ -Wall -ansi -pedantic tst25.C
/d2a/exper/include/g++/std/bastring.h: In method `void basic_string<unsigned char,string_char_traits<unsigned char>,__default_alloc_template<false,0> >::Rep::release()':
/d2a/exper/include/g++/std/bastring.h:76: warning: inline function `static void basic_string<unsigned char,string_char_traits<unsigned char>,__default_alloc_template<false,0> >::Rep::operator delete(void *)' called before definition
/d2a/exper/include/g++/std/bastring.h:76: warning: inline function `static void basic_string<unsigned char,string_char_traits<unsigned char>,__default_alloc_template<false,0> >::Rep::operator delete(void *)' called before definition
ld: Undefined symbol 
   basic_string<unsigned char, string_char_traits<unsigned char>, __default_alloc_template<false, 0> >::replace(unsigned int, unsigned int, unsigned char const *, unsigned int)
   basic_string<unsigned char, string_char_traits<unsigned char>, __default_alloc_template<false, 0> >::nilRep
   ___dl__Q2t12basic_string3ZUcZt18string_char_traits1ZUcZt24__default_alloc_template2b0i03RepPv 
   _clone__Q2t12basic_string3ZUcZt18string_char_traits1ZUcZt24__default_alloc_template2b0i03Rep 
collect2: ld returned 2 exit status



More information about the Gcc-bugs mailing list