[gst-devel] Problems compiling pygst on Mac OS X

gideon may gideonmay at gmail.com
Mon Nov 20 14:51:13 CET 2006


Hi,

I'm trying to compile gst-python on OS X 10.4.8 and run in a number of
problems.
First of all, I have a running gstreamer environment compiled from the CVS
repository.
All the unit tests complete successfully including all the 30+ libraries on
which gstreamer
depends.

When I compile gst-python, make bails out with the following errors:

==================================================
generating symbol list for `_gst.la'
/usr/bin/nm -p  .libs/_gst_la-gst-argtypes.o
.libs/_gst_la-gstmodule.o.libs/_gst_la-
pygstiterator.o .libs/_gst_la-pygstminiobject.o
.libs/_gst_la-pygstvalue.o.libs/_gst_la-
pygstexception.o .libs/_gst_la-gst.o  | sed -n -e 's/^.*[
]\([BCDEGRST][BCDEGRST]*\)[     ][      ]*_\([_A-Za-z][_A-Za-z0-9]*\)$/\1
_\2 \2/p' | /usr/bin/sed 's/.* //' | sort | uniq > .libs/_gst.exp
/usr/bin/grep -E -e "^(init_gst|_PyGObject_API).*" ".libs/_gst.exp" >
".libs/_gst.expT"
mv -f ".libs/_gst.expT" ".libs/_gst.exp"
sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < .libs/_gst.exp >
.libs/_gst- symbols.expsym
gcc ${wl}-flat_namespace ${wl}-undefined ${wl}suppress -o .libs/_gst.so
-bundle  .libs/_gst_la-gst-argtypes.o .libs/_gst_la-gstmodule.o.libs/_gst_la-
pygstiterator.o .libs/_gst_la-pygstminiobject.o .libs/_gst_la-
pygstvalue.o.libs/_gst_la-
pygstexception.o .libs/_gst_la-gst.o  -L/Users/gideon/build_darwin/lib
-L/Users/gideon/build_darwin//lib
/Users/gideon/build_darwin/lib/libgstcontroller-0.10.dylib/Users/gideon/build_darwin/lib/libgstnet-
0.10.dylib /Users/gideon/build_darwin/lib/libgstdataprotocol-0.10.dylib/Users/gideon/build_darwin/lib/libgstbase-
0.10.dylib /Users/gideon/build_darwin/lib/libgstreamer-0.10.dylib/Users/gideon/build_darwin//lib/libgobject-
2.0.dylib /Users/gideon/build_darwin//lib/libgmodule-2.0.dylib/Users/gideon/build_darwin//lib/libgthread-
2.0.dylib /Users/gideon/build_darwin//lib/libxml2.dylib -lpthread -lz -lm
/Users/gideon/build_darwin//lib/libglib-2.0.dylib/Users/gideon/build_darwin//lib/libintl.dylib
/Users/gideon/build_darwin//lib/libiconv.dylib
/usr/bin/ld: multiple definitions of symbol _PyGstIterator_Type
.libs/_gst_la-gst-argtypes.o definition of _PyGstIterator_Type in section
(__DATA,__common)
.libs/_gst_la-gstmodule.o definition of _PyGstIterator_Type in section
(__DATA,__common)
/usr/bin/ld: multiple definitions of symbol __PyGObject_API
.libs/_gst_la-gst-argtypes.o definition of __PyGObject_API in section
(__DATA,__common)
.libs/_gst_la-gstmodule.o definition of __PyGObject_API in section
(__DATA,__common)
.libs/_gst_la-pygstiterator.o definition of _PyGstIterator_Type in section
(__DATA,__data)
.libs/_gst_la-pygstiterator.o definition of __PyGObject_API in section
(__DATA,__common)
.libs/_gst_la-pygstminiobject.o definition of _PyGstIterator_Type in section
(__DATA,__common)
.libs/_gst_la-pygstminiobject.o definition of __PyGObject_API in section
(__DATA,__common)
.libs/_gst_la-pygstvalue.o definition of _PyGstIterator_Type in section
(__DATA,__common)
.libs/_gst_la-pygstvalue.o definition of __PyGObject_API in section
(__DATA,__common)
.libs/_gst_la-gst.o definition of _PyGstIterator_Type in section
(__DATA,__common)
.libs/_gst_la-gst.o definition of __PyGObject_API in section
(__DATA,__common)
collect2: ld returned 1 exit status
make[3]: *** [_gst.la] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
==================================================

It seems that the objects PyGstIterator_Type and _PyGObject_API have
multiple definitions, which is in violation of the 'One Definition Rule'.

I've been able to compile and run the tests successfully after applying the
following patches:
Index: gst/common.h
===================================================================
RCS file: /cvs/gstreamer/gst-python/gst/common.h,v
retrieving revision 1.14
diff -r1.14 common.h
56c56
< PyTypeObject PyGstIterator_Type;
---
> extern PyTypeObject PyGstIterator_Type;
Index: gst/pygstiterator.c
===================================================================
RCS file: /cvs/gstreamer/gst-python/gst/pygstiterator.c,v
retrieving revision 1.5
diff -r1.5 pygstiterator.c
22a23,24
> #define NO_IMPORT_PYGOBJECT
>
24a27,28
> PyTypeObject PyGstIterator_Type;
>
Index: gst/pygstminiobject.c
===================================================================
RCS file: /cvs/gstreamer/gst-python/gst/pygstminiobject.c,v
retrieving revision 1.16
diff -r1.16 pygstminiobject.c
22a23,24
> #define NO_IMPORT_PYGOBJECT
>
Index: gst/pygstminiobject.h
===================================================================
RCS file: /cvs/gstreamer/gst-python/gst/pygstminiobject.h,v
retrieving revision 1.5
diff -r1.5 pygstminiobject.h
48c48
< struct _PyGObject_Functions *_PyGObject_API;
---
> extern struct _PyGObject_Functions *_PyGObject_API;

It might be that this fixes bug 343980, since I had a the same crash at
pyg_register_interface before having had a complete fix.

Ciao,

Gideon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20061120/a36ef17a/attachment.htm>


More information about the gstreamer-devel mailing list