This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: string
- To: tudor at cs dot unh dot edu
- Subject: Re: string
- From: hjl at lucon dot org (H.J. Lu)
- Date: Wed, 4 Feb 1998 08:14:29 -0800 (PST)
- Cc: egcs at cygnus dot com, drepper at cygnus dot com (Ulrich Drepper), libc-linux at gnu dot org (GNU C Library)
>
>
> Hi,
>
> I have installed gcc-2.8.0 + libstdc++-2.8.0 + binutils-2.8.1.0.20.
>
Are you using glibc 2? There is a known bug in libstdc++ on glibc 2
systems. We have several choices:
1. Don't make libstdc++ MT-safe, which is bad.
2. Build multilib for libstdc++, MT-safe and ST, which is very
inconvenient to build and use.
3. Modify libstdc++ to make it both MT-safe and linkable with ST
programms.
I have patches for (3). But it changes STL and people don't agree
with me on that. The current egcs has the part of my patches which
basically does (1). I'd like to see libstdc++ be fixed soon, one way
or the other.
FYI, a patch for linuxthreads is also needed. Ulrich, could you
please check it into glibc 2.0.7 and 2.1? Thanks.
> I've noticed a problem: a very simple program using `string' won't
> link. I've seen on the newsgroups that several people experienced the
> same problem, but I couldn't find any suggestion or fix for it. Could
> you please tell me what shall I do in order to be able to compile
> programs using the string class?
>
> Thanks,
> Tudor
>
> #include <string>
>
> int
> main ()
> {
> string s = "Hello world!\n";
> }
>
> [tudor@hal2]:~src/misc $ c++ s.cc
> /tmp/cca002981.o: In function `basic_string<char, string_char_traits<char>, __default_alloc_template<false, 0> >::basic_string(char const *)':
> /tmp/cca002981.o(.gnu.linkonce.t.__t12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b0i0PCc+0xc): undefined reference to `basic_string<char, string_char_traits<char>, __default_alloc_template<false, 0> >::nilRep'
> /tmp/cca002981.o: In function `basic_string<char, string_char_traits<char>, __default_alloc_template<false, 0> >::assign(char const *, unsigned int)':
> /tmp/cca002981.o(.gnu.linkonce.t.assign__t12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b0i0PCcUi+0x17): undefined reference to `basic_string<char, string_char_traits<char>, __default_alloc_template<false, 0> >::replace(unsigned int, unsigned int, char const *, unsigned int)'
> /tmp/cca002981.o: In function `grab__Q2t12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b0i03Rep':
> /tmp/cca002981.o(.gnu.linkonce.t.grab__Q2t12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b0i03Rep+0xf): undefined reference to `clone__Q2t12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b0i03Rep'
> /tmp/cca002981.o: In function `release__Q2t12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b0i03Rep':
> /tmp/cca002981.o(.gnu.linkonce.t.release__Q2t12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b0i03Rep+0x13): undefined reference to `__dl__Q2t12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b0i03RepPv'
>
>
>
--
H.J. Lu (hjl@gnu.org)
---
--- sysdeps/pthread/pthread.h.orig Mon Feb 2 09:31:30 1998
+++ sysdeps/pthread/pthread.h Sun Feb 1 12:00:00 1998
@@ -535,8 +535,10 @@
/* Modify the signal mask for the calling thread. The arguments have
the same meaning as for sigprocmask(2). */
+#if __sigset_t_defined
extern int pthread_sigmask __P ((int __how, __const sigset_t *__newmask,
sigset_t *__oldmask));
+#endif
/* Send signal SIGNO to the given thread. */