This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: libstdc++.so: undefined reference to `pthread_create'
- From: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- To: jlquinn at optonline dot net (Jerry Quinn)
- Cc: libstdc++ at gcc dot gnu dot org
- Date: Sat, 15 Nov 2003 00:21:33 -0500 (EST)
- Subject: Re: libstdc++.so: undefined reference to `pthread_create'
> John David Anglin writes:
> > The following error occured today with the cvs source for 3.4
> > building hppa-unknown-linux-gnu:
> >
> > /home/dave/gnu/gcc-3.4/objdir/gcc/g++ -shared-libgcc -B/home/dave/gnu/gcc-3.4/objdir/gcc/ -nostdinc++ -B/home/dave/opt/gnu/hppa-linux/bin/ -B/home/dave/opt/gnu/hppa-linux/lib/ -isystem /home/dave/opt/gnu/hppa-linux/include -isystem /home/dave/opt/gnu/hppa-linux/sys-include -include bits/stdc++.h -g -O2 -D_GNU_SOURCE -o abi_check abi_check.o -L/home/dave/gnu/gcc-3.4/objdir/hppa-linux/libstdc++-v3/src -L/home/dave/gnu/gcc-3.4/objdir/hppa-linux/libstdc++-v3/src/.libs -lm
> > /home/dave/gnu/gcc-3.4/objdir/hppa-linux/libstdc++-v3/src/.libs/libstdc++.so: un defined reference to `pthread_create'
> > /home/dave/gnu/gcc-3.4/objdir/hppa-linux/libstdc++-v3/src/.libs/libstdc++.so: undefined reference to `pthread_getspecific'
> > /home/dave/gnu/gcc-3.4/objdir/hppa-linux/libstdc++-v3/src/.libs/libstdc++.so: undefined reference to `pthread_once'
> > /home/dave/gnu/gcc-3.4/objdir/hppa-linux/libstdc++-v3/src/.libs/libstdc++.so: undefined reference to `pthread_key_create'
> > /home/dave/gnu/gcc-3.4/objdir/hppa-linux/libstdc++-v3/src/.libs/libstdc++.so: undefined reference to `pthread_setspecific'
> > collect2: ld returned 1 exit status
> >
> > Any ideas?
>
> -lpthread?
>
> Or is that implied on hp linux?
No, it's not implied. It requires `-pthread' in the link command. Probably
what has happened is that there has been a changed the the v3 library
which now requires abi_check to be linked against the pthread library.
The testsuite seems to add `-pthread' in the thread tests.
Dave
--
J. David Anglin dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6602)