This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
gcc 3.1.x and std::basic_string< xxx >::replace( xxx ) link errors - please help
- From: "Dylan Cuthbert" <dylan at q-games dot com>
- To: <gcc at gcc dot gnu dot org>
- Date: Fri, 12 Jul 2002 00:34:46 +0900
- Subject: gcc 3.1.x and std::basic_string< xxx >::replace( xxx ) link errors - please help
Hi there,
I have downloaded the very latest 3.11 version of gcc for cygwin.
I have also tried compiling my own version of gcc 3.1.x.
This version - "g++ (GCC) 3.1 20020325 (prerelease) " does *not* give the
link error I'm about to describe:
The current gcc version I am using is:
--- snip ----
$ g++ -v
Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/3.1.1/specs
Configured with:
/netrel/src/gcc-3.1.1-2/configure --enable-languages=c,c++,f77,java --enable
-libgcj --enable-threads=posix --with-system-zlib --enable-nls --without-inc
luded-gettext --disable-shared --enable-interpreter --disable-sjlj-exception
s --disable-version-specific-runtime-libs --build=i686-pc-linux --host=i686-
pc-cygwin --target=i686-pc-cygwin --enable-haifa --prefix=/usr --exec-prefix
=/usr --sysconfdir=/etc --libdir=/usr/lib --includedir=/nonexistent/include
--libexecdir=/usr/sbin : (reconfigured)
Thread model: posix
gcc version 3.1.1 20020710 (prerelease)
---- snip ----
With any long and complicated piece of code using strings I get this error
(and sometimes others from other functions in stdlib).
undefined reference to `
std::basic_string<char, std::char_traits<char>, std::allocator<char>
>::replace(std::__normal_iterator<char*, std::basic_string<char,
std::char_traits<char>, std::allocator<char> > >,
std::__normal_iterator<char*, std::basic_string<char,
std::char_traits<char>, std::allocator<char> > >, unsigned, char)'
collect2: ld returned 1 exit status
This might be related to the #pragma interface/implementation stuff as we
also tried to use these (we aren't anymore) and got spurious link errors
from symbols in .cpp files that were simply including header files with the
#pragma interface command in them. I just happened to notice that
"basic_string.tcc" etc. use a similar #pragma.
The things I have tried so far:
I "hacked" the basic_string.tcc file and placed junk in the replace command
above to make sure the file was being compiled - it reported the error
correctly.
2. I #if 0'd the entire basic_string.tcc file and block copied its contents
(minus #pragma and other stuff ) into my own code - it complained about more
symbols being missing (on top of the replace).
Does anyone have any ideas where to even start?
Regards
---------------------------------
Q-Games, Dylan Cuthbert.
http://www.q-games.com