[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Swftools-common] Compiling pyswf on OS X

From: Ksenia Marasanova
Subject: Re: [Swftools-common] Compiling pyswf on OS X
Date: Sat, 30 Oct 2004 23:18:20 +0200

Could you try replacing
   $(L) [...]
   ../../libtool $(L) [...]
in lib/python/Makefile (line 30), and running "make" again?

If it complains about "-shared" again, please also try removing
"-shared" from the Makefile as well and again running "make".

Did both... still the same:

gcc -DHAVE_CONFIG_H -g SWF.o tagmap.o taglist.o tag.o image.o tags.o
action.o primitives.o pyutils.o -o SWF.so -framework Python
../librfxswf.a -L/usr/local/lib /usr/local/lib/libt1.a
/usr/local/lib/libjpeg.62.0.0.dylib -lm
/usr/local/lib/libfreetype.dylib -lz
ld: Undefined symbols:
make[1]: *** [SWF.so] Error 1
make: *** [all] Error 2

Ok, seems libtool is unillumined about MacOS X, too.
Do you have a static libtool (libtool --version) on you system?
it should be part of the automake package.
If yes, could you try "libtool" instead of "../../libtool" and
run "make" again?

Actually, libtool on OS X appears to have a name "glibtool". "libtool" is something else... how nice of Apple :/. But... I think it finally works :). After lots of googling and reading man pages it appears to be the -shared option that OS X gcc is unaware of. To compile a .so module it must be replaces by -bundle option. So the line in lib/python/Makefile must be changed from
$(L) -g -shared [...]
$(L) -g -bundle [...]

and it compiles.
Cool :)

Other minor problems I ran into that other may find helpfull:

First of all, I tried the Picture Distorter script out. Running it produced an error:
Traceback (most recent call last):
  File "test.py", line 13, in ?
File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/site-packages/PIL/ImageFile.py", line 151, in load
File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/site-packages/PIL/ImageFile.py", line 206, in load_prepare
    self.im = Image.core.new(self.mode, self.size)
File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/site-packages/PIL/Image.py", line 39, in __getattr__
    raise ImportError("The _imaging C module is not installed")
ImportError: The _imaging C module is not installed

Hmm... it's not true. It *is* installed. I changed the import order from
import SWF
import Image


import Image
import SWF

and the script came with a clearer error:

Traceback (most recent call last):
  File "test.py", line 4, in ?
    import SWF
ImportError: Failure linking new module: : dyld: python multiple definitions of symbol _jpeg_write_tables
/sw/lib/libjpeg.62.dylib(jcapimin.lo) definition of _jpeg_write_tables
/usr/local/lib/libjpeg.62.dylib(jcapimin.o) definition of _jpeg_write_tables

I removed the Fink version (the first one) and ImportError was gone.
Next try:

Traceback (most recent call last):
  File "test.py", line 20, in ?
    startframe = stream.addFrame(peppers, quant=15)
Exception: bad image width 300!=304

Script did'nt like my JPG file, exported from iPhoto. I tried several other JPG and PNG files saved from Photoshop, even not compressed - same result. Any idea what could be wrong? The peppers.png from your site worked as expected :)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]