Subject: problem with pthreads
To: None <netbsd-help@netbsd.org>
From: Nathan Langford <nathanl@remus.rutgers.edu>
List: netbsd-help
Date: 02/11/2002 12:16:46
I was trying to compile mplayer and xine, but both ./configure scripts
reported missing pthread libraries. I've installed the pth package, and I
added an option to ./configure (--with-extralibdirs=/usr/pkg/lib/) where
the libpth and libpthread files are, but it still won't register. I
figure I'm probably missing something obvious...
Here's the part of configure (mplayer) that checks for pth:
echocheck "pthread"
cat > $TMPC << EOF
#include <pthread.h>
void* func(void *arg) { return arg; }
int main(void) { pthread_t tid; return pthread_create (&tid, 0, func, 0)
== 0 ?
0 : 1; }
EOF
if ( cc_check && $TMPO ) ; then # QNX
_ld_pthread=''
elif ( cc_check -lpthread && $TMPO ) ; then
_ld_pthread='-lpthread'
elif ( cc_check -pthread && $TMPO ) ; then
_ld_pthread='-pthread'
else
die "Lib pthread not found. (needed by windows and networking stuff)"
fi
echores "yes (using $_ld_pthread)"
and here's part of configure.log that relates:
============ Checking for pthread ============
#include <pthread.h>
void* func(void *arg) { return arg; }
int main(void) { pthread_t tid; return pthread_create (&tid, 0, func, 0)
== 0 ?
0 : 1; }
gcc /tmp/mplayer-conf--1286.c -o /tmp/mplayer-conf--1286.o
/tmp/mplayer-conf--1286.c:1: pthread.h: No such file or directory
ldd /tmp/mplayer-conf--1286.o
ldd: /tmp/mplayer-conf--1286.o: unrecognized file format
Any suggestions are greatly appreciated.
Best,
Nathan