This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


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

wide string template instantiation



guavac, a free Java bytecode compiler, was written in C++, and uses
basic_string<unsigned short> to represent 16-bit unicode character
sequences.  Back in gcc 2.7.3, I used manual template instantiation files
to create the necessary symbols, but in egcs-1.0.2, I was hoping that the
new-fangled automatic mechanisms would take care of this.

Unfortunately, when I try to compile this file with egcs, it doesn't
automatically instantiate the necessary symbols:

    #include <string>
    int main() {
      basic_string<unsigned short> s;
      return 0;
    }

I tried applying a patch posted by HJL in February, but it doesn't seem to
solve the problem.  Is this a bug, or is there documentation about proper
use of the new template instantiation features somewhere?



> gcc -v -g StringTest.cpp -lstdc++
Reading specs from
/usr/local/egcs/lib/gcc-lib/i586-pc-linux-gnulibc1/egcs-2.90.27/specs
gcc version egcs-2.90.27 980315 (egcs-1.0.2 release)
 /usr/local/egcs/lib/gcc-lib/i586-pc-linux-gnulibc1/egcs-2.90.27/cpp
-lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus
-D__GNUC_MINOR__=90 -Di386 -D__ELF__ -Dunix -Dlinux -D__i386__ -D__ELF__
-D__unix__ -D__linux__ -D__i386 -D__unix -D__linux -Asystem(posix)
-D__EXCEPTIONS -g -Di386 -Di586 -Asystem(unix) -Acpu(i386) -Amachine(i386)
-D__i386__ -D__i586__ -Asystem(unix) -Acpu(i386) -Amachine(i386)
StringTest.cpp /tmp/cca09225.ii
GNU CPP version egcs-2.90.27 980315 (egcs-1.0.2 release) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/egcs/include/g++
 /usr/local/include
 /usr/local/egcs/i586-pc-linux-gnulibc1/include
 /usr/local/egcs/lib/gcc-lib/i586-pc-linux-gnulibc1/egcs-2.90.27/include
 /usr/include
End of search list.
 /usr/local/egcs/lib/gcc-lib/i586-pc-linux-gnulibc1/egcs-2.90.27/cc1plus
/tmp/cca09225.ii -quiet -dumpbase StringTest.cc -g -version -o
/tmp/cca09225.s
GNU C++ version egcs-2.90.27 980315 (egcs-1.0.2 release)
(i586-pc-linux-gnulibc1) compiled by GNU C version 2.7.2.
 as -V -Qy -o /tmp/cca092251.o /tmp/cca09225.s
GNU assembler version 970202 (i586-linux), using BFD version 2.7.0.9
 /usr/local/egcs/lib/gcc-lib/i586-pc-linux-gnulibc1/egcs-2.90.27/ld -m
elf_i386 -dynamic-linker /lib/ld-linux.so.1 /usr/lib/crt1.o
/usr/lib/crti.o
/usr/local/egcs/lib/gcc-lib/i586-pc-linux-gnulibc1/egcs-2.90.27/crtbegin.o
-L/usr/local/egcs/lib/gcc-lib/i586-pc-linux-gnulibc1/egcs-2.90.27
-L/usr/local/egcs/i586-pc-linux-gnulibc1/lib -L/usr/local/egcs/lib
/tmp/cca092251.o -lstdc++ -lgcc -lc -lgcc
/usr/local/egcs/lib/gcc-lib/i586-pc-linux-gnulibc1/egcs-2.90.27/crtend.o
/usr/lib/crtn.o
/tmp/cca092251.o: In function `basic_string<unsigned short,
string_char_traits<unsigned short>, __default_alloc_template<false, 0>
>::rep(void) const':
/usr/local/egcs/include/g++/std/bastring.h:76: undefined reference to
`basic_string<unsigned short, string_char_traits<unsigned short>,
__default_alloc_template<false, 0> >::nilRep'
/usr/local/egcs/include/g++/std/bastring.h:156: undefined reference to
`clone__Q2t12basic_string3ZUsZt18string_char_traits1ZUsZt24__default_alloc_template2b0i03Rep'
/tmp/cca092251.o: In function `basic_string<unsigned short,
string_char_traits<unsigned short>, __default_alloc_template<false, 0>
>::rep(void) const':
/tmp/StringTest.cpp:4: undefined reference to
`__dl__Q2t12basic_string3ZUsZt18string_char_traits1ZUsZt24__default_alloc_template2b0i03RepPv'
collect2: ld returned 1 exit status




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