linux64下安装swftools
在文档转换器中,需要在linux上安装swftools,经历了一番曲折过程终于安装成功。swftools安装包从http://www.swftools.org/download.html上面下载。
在./configure过程中会提示需要依赖包freetype和jpegsrc,这两个依赖包可以从官网上下载,也可以从swftools上下载http://download.savannah.gnu.org/releases/freetype/和http://www.ijg.org/files/上下载。
- 安装freetype-2.5.3.tar.gz
tar -xzvf freetype-2.5.3.tar.gz
cd freetype-2.5.3
./configure
make
make install
- 安装jpegsrc.v9a.tar.gz
tar -xzvf jpegsrc.v9a.tar.gz
cd jpeg-9a
./configure
make
make install
- 安装swftools
tar -xzvf swftools-2013-04-09-1007.tar.gz
cd swftools-2013-04-09-1007
ldconfig /usr/local/lib
提示错误ldconfig: /lib64/libz.so.1 is not a symbolic link, 解决方法是
cd /lib64/
ls -al
看到libz.so.1不是一个连接而是一个文件
rm -rf libz.so.1
ln -s /lib64/libz.so.1.2.8 /lib64/libz.so.1
继续执行
./configure --prefix=/usr/local/swftools
make
在编译jpeg.c时出错,见图
源代码错误,提示swftools-2013-04-09-1007/lib/jpeg.c没有定义常量TRUE,检查并修改jpeg.c文件,添加以下内容
#include "types.h"
屏蔽365行的typedef unsigned char U8后,重新编译swftools
另外几种错误
gif2swf.c: In function ‘MovieAddFrame’:
gif2swf.c:233: error: too few arguments to function ‘DGifOpenFileName’
gif2swf.c:239: warning: implicit declaration of function ‘PrintGifError’
gif2swf.c:458: error: too few arguments to function ‘DGifCloseFile’
gif2swf.c: In function ‘CheckInputFile’:
gif2swf.c:491: error: too few arguments to function ‘DGifOpenFileName’
gif2swf.c:521: error: too few arguments to function ‘DGifCloseFile’
make[1]: *** [gif2swf.o] Error 1
make[1]: Leaving directory `/home/pjroot/swftools-2013-04-09-1007/src'
make: *** [all] Error 2
错误原因:
由于giflib 5.1的DGifOpenFileName函数和DGifCloseFile函数参数签名发生变化,而gif2swf.c中调用仍然使用旧有版本导致参数不匹配
DGifOpenFileName变化
GifFileType *DGifOpenFileName(char *GifFileName)//old
GifFileType *DGifOpenFileName(char *GifFileName, int *ErrorCode) //new
DGifCloseFile变化
int DGifCloseFile(GifFileType *GifFile) // old
int DGifCloseFile(GifFileType *GifFile, int *ErrorCode) //new
解决方法:
gif2swf.c 中几处做修改
233和491行
if ((gft = DGifOpenFileName(sname)) == NULL) {
改为
if ((gft = DGifOpenFileName(sname, 0)) == NULL) {
458和512行
DGifCloseFile(gft);改为 DGifCloseFile(gft, NULL);
making all in m4...
cd m4;make all
make[1]: Entering directory `/home/pjroot/swftools-2013-04-09-1007/m4'
make[1]: Leaving directory `/home/pjroot/swftools-2013-04-09-1007/m4'
making all in lib...
cd lib;make all
make[1]: Entering directory `/home/pjroot/swftools-2013-04-09-1007/lib'
gcc -c -DHAVE_CONFIG_H -I/usr/local/swftools/include -I/usr/local/include/freetype2 -I/usr/local/include -fPIC -Wimplicit -Wreturn-type -Wno-write-strings -Wformat -O -fomit-frame-pointer rfxswf.c -o rfxswf.o
In file included from ./bitio.h:23,
from rfxswf.h:37,
from rfxswf.c:28:
./types.h:39:2: error: #error "no way to define 64 bit integer"
./types.h:42:2: error: #error "don't know how to define 32 bit integer"
./types.h:45:2: error: #error "don't know how to define 16 bit integer"
./types.h:48:2: error: #error "don't know how to define 8 bit integer"
make[1]: *** [rfxswf.o] Error 1
make[1]: Leaving directory `/home/pjroot/swftools-2013-04-09-1007/lib'
make: *** [all] Error 2
错误原因:
没有连接到库,执行以下命令
ldconfig /usr/local/lib
再次重新configure并make安装
./configure --prefix=/usr/local/swftools
make
make install
make clean
make distclean
</pre></div></div><p></p><ul><li>测试是否安装正确</li></ul><p><pre name="code" class="plain">pdf2swf -s languagedir=/usr/local/share/xpdf/chinese-simplified -T 9 -s poly2bitmap -s zoom=150 -s flashversion=9 2.pdf -o 2.swf
linux64下安装swftools的更多相关文章
- linux下安装swftools工具
swfTools是一种实用工具与Adobe Flash文件(swf文件)工作的集合.可以把(pdf/gif/png/jpeg/jpg/font/wav) 7种格式转换为swf文件.一般常用于文件在线浏 ...
- 在UEFI下安装windows和Ubuntu双系统目前不可行
UEFI是BIOS的升级,未来将取代BIOS,说白了,就是跟BISO差不多的作用.但是目前比较新的主板兼容两种设置就比较坑了,默认是UEFI,UEFI下只能安装win8以上的版本,和linux64位系 ...
- linux 下安装jdk及配置jdk环境图解
linux 下安装jdk及配置jdk环境图解 一:先检測是否已安装了JDK 运行命令: # rpm -qa|grep jdk 或 # rpm -q jdk 或 #find / -name j ...
- Ubuntu16.04下安装MATLAB 2016b!完美运行
目录 1.下载MATLAB 2016b 2.挂载iso 3.安装MATLAB 4.破解 5.快捷键与运行 1.下载MATLAB 2016b 下载matlab 2016b for linux(可以百度搜 ...
- linux下安装cmake方法(1)---下载压缩包
OpenCV 2.2以后的版本需要使用Cmake生成makefile文件,因此需要先安装cmake:还有其它一些软件都需要先安装cmake 1.在linux环境下打开网页浏览器,输入网址:http:/ ...
- 在windows下安装gulp —— 基于 Gulp 的前端集成解决方案(一)
相关连接导航 在windows下安装gulp —— 基于 Gulp 的前端集成解决方案(一) 执行 $Gulp 时发生了什么 —— 基于 Gulp 的前端集成解决方案(二) 常用 Gulp 插件汇总 ...
- Ubuntu1604下安装Liggghts及CFDEM Coupling
部分内容参考http://www.linuxdiyf.com/linux/16315.html LIGGGHTS是一款开源的DEM软件,来自于著名的分子动力学软件LAMMPS,目前借助于CFDEM C ...
- 在Ubuntu下安装ovs-dpdk
在Ubuntu下安装ovs-dpdk 参考资料:https://software.intel.com/zh-cn/articles/using-open-vswitch-with-dpdk-on-ub ...
- CentOS 6.3下 安装 Mono 3.2 和Jexus 5.4
最新更新参看: Centos 7.0 安装Mono 3.4 和 Jexus 5.6 2012年初写过一篇<32和64位的CentOS 6.0下 安装 Mono 2.10.8 和Jexus 5.0 ...
随机推荐
- Windows下Redis中RedisQFork位置调整
redis-server.exe redis.windows.conf 使用上面命令启动redis服务的时候报了以下错误信息: The Windows version of Redis allocat ...
- kernel 校验和实现
kernel 校验和实现 Kernel checksum implementation ) TCP包的错误检测使用16位累加和校验. 除了TCP包本身, TCP校验数据块还包括源IP地址,目的IP地址 ...
- bzoj2285
完全是为了拼凑才出出来的吧先分数规划求出到基地入口的最小安全系数然后再最小点权覆盖集,只不过这里是带一定精度实数的流,其实是一样的 ; eps=0.001; type way=record po,ne ...
- Linux下对拍脚本与随机数生成器
对拍脚本 新建一个文档 check.sh 作为对拍脚本. #!/bin/bash while(true)do #死循环 ./data > .in #运行数据生成器,将数据输出到1.in ./st ...
- (转载)Linux系统调用及用户编程接口(API)
(转载)http://www.farsight.com.cn/news/emb167.htm 1 Linux系统调用 所谓系统调用是指操作系统提供给用户程序调用的一组“特殊”接口,用户程序可以通过这组 ...
- How to make project not set to be build
1.BUILD->Configuration Management... 2. When you guys add new projects to the kiosk solution plea ...
- 离散数学A
自反性:(都自指)所有的点自己指向自己[<a,a><b,b>]:反自反性:(都不自指)所有的点都绝不自己指向自己:对称性:但凡指,定互指[<a,b>,<b,a ...
- Apache支持.htaccess配置方法
打开httpd.conf文件用文本编辑器打开后,查找 代码如下 复制代码 Options FollowSymLinks AllowOverride None 改为: Options FollowSy ...
- Vim常用的快捷键列表
insert: i:insert at now position 在光标之前插入 a:insert append 在光标之后插入 o:下面新建一行插入 s:删除后插入 <<:delete ...
- hdoj 5443 The Water Problem【线段树求区间最大值】
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5443 刷道水题助助兴 #include<stdio.h> #include<stri ...