How to compile/link swftools on Unix/Linux
- Some distributions of Linux have swftools available in their standard repositories. In this case, installation is immediate: just use the package manager and order it to install swftools. For example, those that use yum it will just require the command (as root) yum install swftools, those with urpmi just urpmi swftools, etc. If this does not work, try the method below (beware of dependency hell!)
- Download swftools-0.x.x.tar.gz. Then type, on the command-line:
tar -zvxf swftools-0.x.x.tar
cd swftools-0.x.x
./configure
make
make install
- (you will have to be root for the last step)
- What libraries do I need to compile swftools on Unix/Linux/BSD?
- You need freetype and jpeglib to compile pdf2swf. Links:
* freetype: http://www.freetype.org
* jpeglib: http://www.ijg.org/files/
- NB jpeglib is now at version 8. Version 6, appears to be no longer available. Should you happen to know a link, please post it here.
libjpeg-6a can be found here - ftp://sunsite.unc.edu/pub/Linux/libs/graphics/
libjpeg 6b1-2 debs here - http://packages.debian.org/search?keywords=libjpeg6
- For the later versions you will also need to place the tar g'zipped distribution of xpdf in the lib/pdf folder of the unpacked SWFTools distribution, i.e.
* cd swftools/lib/pdf
* wget ftp://ftp.foolabs.com/pub/xpdf/xpdf-3.02.tar.gz
* cd ../../
* ./configure [ -- your_compiler_flags ]
- When compiling, configure might give the following error -
checking for missing libraries... ungif gif_lib.h
***************************************************
* The following headers/libraries are missing: ungif gif_lib.h
* Disabling gif2swf tool...
***************************************************
- ungif may no longer be used in your distro.
- libgif-dev is the new build package, use this instead.
- When compiling the sourcecode version, configure doesn't find my jpeglib!
- In case some of your libraries/include files are installed in /usr/local, try the following:
rm -f config.cache
LDFLAGS="-L/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure
- Furthermore, a new installation of jpeglib (the following assumes it's in /usr/local/lib) often requires doing a:
ranlib /usr/local/lib/libjpeg.a
ldconfig /usr/local/lib
- In order to install jpeglib, it's furthermore been remarked that you need to do:
make install-lib
make install-headers
- If it still doesn't work, try removing the file "config.cache" before running configure again.
- There are problems during compilation
- Error messages complain about "undefined reference to `operator new(unsigned)'" as well as "undefined reference to `__gxx_personality_v0'".
- Try running configure as
LDFLAGS=-lstdc++ ./configure