x42/xjadeo

Linking with pthreads

Closed this issue · 0 comments

When building with Posix QM disabled, it tries to use pthread, and i get several errors about undefined references:

$ ./configure --disable-portmidi --disable-mq
.....leads to.....
gcc "-DSUBVERSION=\"v0.8.7-5-g8fa8b57\"" -g -O2   -o xjremote xjremote-xjremote.o  -L/usr/X11R6/lib
xjremote-xjremote.o: In function `main':
/home/nick87720z/dist/xjadeo/src/xjadeo/xjremote.c:715: warning: the use of `tempnam' is dangerous, better use `mkstemp'
/home/nick87720z/dist/xjadeo/src/xjadeo/xjremote.c:752: undefined reference to `pthread_create'
/home/nick87720z/dist/xjadeo/src/xjadeo/xjremote.c:764: undefined reference to `pthread_cancel'
/home/nick87720z/dist/xjadeo/src/xjadeo/xjremote.c:765: undefined reference to `pthread_join'

Configuring with LDFLAGS=-lpthreads solves issue.

Don't know, is --disable-mq only issue trigger.
Grepping for <pthread.h> gives this list:
./src/xjadeo/xjadeo.c:25:#include <pthread.h>
./src/xjadeo/xjremote.c:314:#include <pthread.h>
./src/xjadeo/xjremote.c:610:#include <pthread.h>
./src/xjadeo/display_gl_win.c:23:#include <pthread.h>
./src/xjadeo/display_gl_osx.m:29:#include <pthread.h>
./src/xjadeo/remote.c:1223:#include <pthread.h>
./src/xjadeo/main.c:37:#include <pthread.h>
./src/xjadeo/midi.c:727:#include <pthread.h>