After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 637308 - gst-plugins-bad did not find xvidcore on my box
gst-plugins-bad did not find xvidcore on my box
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
0.10.20
Other Linux
: Normal critical
: 0.10.21
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 637823 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2010-12-15 14:42 UTC by Jerry Geis
Modified: 2010-12-29 16:12 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jerry Geis 2010-12-15 14:42:26 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.
Comment 1 Sebastian Dröge (slomo) 2010-12-15 16:24:22 UTC
xvidcore should be explicitely linked to libpthread if it uses symbols from libpthread.
Comment 2 Jerry Geis 2010-12-15 17:43:13 UTC
Forgive me but I dont know what "explicitely linked" is or how to do it.

Jerry
Comment 3 Sebastian Dröge (slomo) 2010-12-15 17:53:03 UTC
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.
Comment 4 Jerry Geis 2010-12-15 18:15:18 UTC
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
Comment 5 Sebastian Dröge (slomo) 2010-12-15 18:18:09 UTC
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
Comment 6 Sebastian Dröge (slomo) 2010-12-22 19:17:25 UTC
*** Bug 637823 has been marked as a duplicate of this bug. ***
Comment 7 Vincent Penquerc'h 2010-12-23 13:38:14 UTC
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.
Comment 8 Jerry Geis 2010-12-23 13:41:44 UTC
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
Comment 9 Vincent Penquerc'h 2010-12-23 15:03:48 UTC
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.
Comment 10 Sebastian Dröge (slomo) 2010-12-24 13:13:39 UTC
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?
Comment 11 Vincent Penquerc'h 2010-12-29 15:49:46 UTC
I had made one:
https://bugzilla.gnome.org/attachment.cgi?id=176893
Comment 12 Tim-Philipp Müller 2010-12-29 16:12:17 UTC
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