【发布时间】:2013-01-22 06:16:46
【问题描述】:
我正在尝试从最新源编译wkhtmltopdf。我使用的是 Ubuntu 12.10 x64 服务器版。
对于wkhtmltopdf-qt 编译,正如作者所说,新的Git repo 位于4.8.2 分支上的gitorious.org/~antialize/qt/antializes-qt.git。所以,这也是我使用的。
一切都很顺利。 (qt 和 wkhtmltopdf)的编译都成功完成。但我只能以 root 身份使用 wkhtmltopdf(使用 sudo)。当我以任何其他用户身份运行它时,出现以下错误。
error while loading shared libraries: libQtWebKit.so.4: cannot open shared object file: No such file or directory.
我以 root 身份完成了所有编译,文件位于 root 用户的主目录 (/root) 中。我猜想 wkhtmltopdf 程序需要读取 wkqt 目录,编译后的 qt 所在的目录(以及 libQtWebKit.so.4 文件)。该目录也位于 root 用户的主目录中,从而阻止其他用户运行wkhtmltopdf。
所以,我决定从头开始。这一次,我将所有的源文件(wkhtmltopdf-qt 和wkhtmltopdf)放在/usr/wkhtmltopdf 中。但是在 qt 的编译过程中,编译器尝试在存在 qt 源 (/root/wkhtmltopdf-qt) 的上一个(旧)位置访问 qmake 时出现错误。
以下错误:
ln -s libQtDeclarative.so.4.8.2 libQtDeclarative.so
ln -s libQtDeclarative.so.4.8.2 libQtDeclarative.so.4
ln -s libQtDeclarative.so.4.8.2 libQtDeclarative.so.4.8
rm -f ../../lib/libQtDeclarative.so.4.8.2
rm -f ../../lib/libQtDeclarative.so
rm -f ../../lib/libQtDeclarative.so.4
rm -f ../../lib/libQtDeclarative.so.4.8
mv -f libQtDeclarative.so.4.8.2 libQtDeclarative.so libQtDeclarative.so.4 libQtDeclarative.so.4.8 ../../lib/
make[1]: Leaving directory `/usr/wkhtmltopdf/wkhtmltopdf-qt/src/declarative'
cd src/3rdparty/webkit/Source/ && make -f Makefile.WebKit
make[1]: Entering directory `/usr/wkhtmltopdf/wkhtmltopdf-qt/src/3rdparty/webkit/Source'
/root/wkhtmltopdf-qt/bin/qmake -spec ../../../../mkspecs/linux-g++-64 -o Makefile.WebKit WebKit.pro
make[1]: /root/wkhtmltopdf-qt/bin/qmake: Command not found
make[1]: *** [Makefile.WebKit] Error 127
make[1]: Leaving directory `/usr/wkhtmltopdf/wkhtmltopdf-qt/src/3rdparty/webkit/Source'
make: *** [sub-webkit-make_default-ordered] Error 2
当我开始使用绝对新鲜的源代码时,我不明白这怎么可能。
有什么方法可以完全删除(卸载)之前安装的wkhtmltopdf-qt 和wkhtmltopdf?
我将不胜感激。谢谢。
【问题讨论】: