libstdc++.so: undefined reference to `pthread_create'
John David Anglin
dave@hiauly1.hia.nrc.ca
Sat Nov 15 05:21:00 GMT 2003
> 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)
More information about the Libstdc++
mailing list