GNOME Bugzilla – Bug 637308
gst-plugins-bad did not find xvidcore on my box
Last modified: 2010-12-29 16:12:17 UTC
configure:39453: checking for xvid.h configure:39453: result: yes configure:39458: checking for xvid_encore in -lxvidcore configure:39483: gcc -std=gnu99 -o conftest -g -O2 conftest.c -lxvidcore -lm >&5 /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/libxvidcore.a(encoder.o): In function `FrameCodeP': encoder.c:(.text+0x1da2): undefined reference to `pthread_create' encoder.c:(.text+0x1df0): undefined reference to `pthread_join' /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/libxvidcore.a(encoder.o): In function `enc_encode': encoder.c:(.text+0x4294): undefined reference to `pthread_create' encoder.c:(.text+0x42e2): undefined reference to `pthread_join' collect2: ld returned 1 exit status The above is the error I got. I had to edit the configure script and change every line of: LIBS="-lxvidcore $LIBS" to be LIBS="-lxvidcore $LIBS -lpthread" This worked for me. I'm not sure its the right way to do it. As you can see its failing on the pthread library and that was not included.
xvidcore should be explicitely linked to libpthread if it uses symbols from libpthread.
Forgive me but I dont know what "explicitely linked" is or how to do it. Jerry
It's a problem either with your distribution package of xvid or xvid's build process. The xvid library has to be linked to libpthread, which it apparently isn't in your case.
But isnt that what ./configure is supposed to do? Determine if something is linked to pthread or if it needs to include pthread in the process? Everything seems to work and run just fine when I do it this way. its just the detection of xvidcore that was lacking. Thanks - I dont mean to be a bother. I use centos and they are not going to change anything for me I would assume. jerry
Well, they really should :) A library should always link to all libraries which it uses and not just assume that someone else will care for this
*** Bug 637823 has been marked as a duplicate of this bug. ***
OK. I digged a bit more, xvidcore does link with pthread, and linking with the shared library works fine. gst-plugins-bad's configure does not seem to try -shared though, so links with the static library, and fails. xvidcore doesn't seem to provide pkg-config files unfortunately, and doesn't have a --disable-static in its ./configure.
Is there something I am supposed to ./configure xvidcore with so it links with pthread? Presently I am doing this: export LDFLAGS=-L/usr/lib64; cd build/generic; ./configure --prefix=/usr --libdir=/usr/lib64 ; make -j 2; make install Jerry
It links its shared library with pthread. The static library is just a standard ar/ranlib archive from its object files. I suspect it would just work if you'd remove the .a archive, though I've not tried.
Good point, I guess my argument is wrong then. Does one of you want to provide a patch to add -lpthread to the xvid libraries in configure?
I had made one: https://bugzilla.gnome.org/attachment.cgi?id=176893
commit 17ab963b104327d0a01071d9028d502dcb45819a Author: Vincent Penquerc'h <vincent.penquerch@collabora.co.uk> Date: Wed Dec 22 14:42:27 2010 +0000 configure: use -pthread for xvid configure check https://bugzilla.gnome.org/show_bug.cgi?id=637823 https://bugzilla.gnome.org/show_bug.cgi?id=637308