redhat as5.4 安装网站截图软件CutyCapt

先安装Qt47
Java代码 收藏代码

增加qt47的下载源
vi /etc/yum.repos.d/atrpms.repo
[atrpms]
name=CentOS $releasever – $basearch – ATrpms
baseurl=http://dl.atrpms.net/el$releasever-$basearch/atrpms/stable
gpgkey=http://ATrpms.net/RPM-GPG-KEY.atrpms
gpgcheck=1
enabled=1

[atrpms-testing]
name=CentOS $releasever – $basearch – ATrpms testing
baseurl=http://dl.atrpms.net/el$releasever-$basearch/atrpms/testing
gpgkey=http://ATrpms.net/RPM-GPG-KEY.atrpms
gpgcheck=1
enabled=1

yum update

yum install qt47
yum install qt47-devel

yum install qt47-webkit
yum install qt47-webkit-devel


安装 CutyCapt
Java代码 收藏代码

svn co https://cutycapt.svn.sourceforge.net/svnroot/cutycapt
mv cutycapt/CutyCapt /usr/local/cutycapt
cd /usr/local/cutycapt
qmake
make


下载个x-server
Java代码 收藏代码

wget http://www.flexthinker.com/wp-content/uploads/2009/11/xvfb-run.sh.txt
mv ./xvfb-run.sh.txt /usr/local/cutycapt/xvfb-run.sh
chmod u+x /usr/local/CutyCapt/xvfb-run.sh


安装中文包

Java代码 收藏代码

yum install fonts-chinese


安装ImageMagick
Java代码 收藏代码

yum install ImageMagick


最后就可以happy的截图了,如下:

Java代码 收藏代码

/usr/local/cutycapt/xvfb-run.sh --server-args="-screen 0, 1024x768x24" /usr/local/cutycapt/CutyCapt --url=http://www.163.com --out=163.jpg
//convert截取第一屏
convert -crop 1024x768+0+0 /data/www/imark-image/screenshot/jVK_LBPG-a4..jpg /data/www/imark-image/screenshot/jVK_LBPG-a4._fs.jpg
//convert缩放第一屏
convert -resize 20%x20% /data/www/imark-image/screenshot/jVK_LBPG-a4._fs.jpg /data/www/imark-image/screenshot/jVK_LBPG-a4._20_20.jpg


常见错误解决办法:

1.问题1:
$ sudo make

And I keep getting the following.....

g++ -c -pipe -g -Wall -W -O2 -D_REENTRANT -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -DQT_SHARED -DQT_TABLET_SUPPORT -I/usr/share/qt3/mkspecs/default -I. -I../../../include/qt3 -o CutyCapt.o CutyCapt.cpp

CutyCapt.cpp:21:24: error: QApplication: No such file or directory

CutyCapt.cpp:22:20: error: QtWebKit: No such file or directory

CutyCapt.cpp:23:17: error: QtGui: No such file or directory

CutyCapt.cpp:24:25: error: QSvgGenerator: No such file or directory

CutyCapt.cpp:25:20: error: QPrinter: No such file or directory

CutyCapt.cpp:26:18: error: QTimer: No such file or directory

CutyCapt.cpp:27:22: error: QByteArray: No such file or directory

CutyCapt.cpp:28:27: error: QNetworkRequest: No such file or directory

In file included from CutyCapt.cpp:29:

CutyCapt.hpp:4: error: expected class-name before ‘{’ token

CutyCapt.hpp:5: error: ISO C++ forbids declaration of ‘Q_OBJECT’ with no type

CutyCapt.hpp:7: error: expected ‘;’ before ‘public’

CutyCapt.hpp:9: error: ISO C++ forbids declaration of ‘QString’ with no type

CutyCapt.hpp:9: error: expected ‘,’ or ‘...’ before ‘&’ token

CutyCapt.hpp:10: error: ISO C++ forbids declaration of ‘QString’ with no type

CutyCapt.hpp:10: error: expected ‘,’ or ‘...’ before ‘&’ token

解决方法:
cd /usr/local/CutyCapt

/usr/bin/qmake-qt4

make

问题2:编译QT出现/usr/lib/libstdc++.so.6:version 'GLIBCXX_3.4.9' not found /usr/lib/libstdc++.so.6:version 'GLIBCXX_3.4.11'not found

解决办法:
把libstdc++.so.6.0.13这个资源放到/usr/lib文件夹下。删除/usr/lib/libstdc++.so.6。

在输入命令ln -s /usr/lib/libstdc++.so.6.0.13 /usr/lib/libstdc++.so.6。问题解决

可以输入strings /usr/lib/libstdc++.so.6 | grep GLIBC查看GLIBCXX_XXX是否在其中


reference links:
http://blog.jangmt.com/2009/10/cutycapt.html
http://snageyang.iteye.com/blog/1128648
http://download.csdn.net/detail/mohanzhaike/3119995

你可能感兴趣的:(CentOS/RedHat)