Fedora 18下使用源码包安装goldendict-1.0.1

下载源码包,这里下载的是goldendict-1.0.1-src.tar.bz2。

建立一个文件夹,并将源码包解压到新建的文件夹中,然后cd到这个文件夹中。

执行./configure,提示:

To build the program, run qmake, then make.

The following dependency packages are required: libvorbis-dev, zlib1g-dev, libhunspell-dev, x11proto-record-dev, qt4-qmake, libqt4-dev, g++, libxtst-dev, libphonon-dev. They can be named slightly different in different distributions.

执行如下命令安装所需依赖,这里安装的版本都是Fedora-18-x86_64-DVD.iso自带的版本:
yum install libvorbis-devel zlib-devel hunspell-devel xorg-x11-proto-devel qt-devel qtwebkit-devel libXtst-devel phonon-devel

执行qmake-qt4,提示:

fatal: Not a git repository (or any parent up to mount point /home)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
Project MESSAGE: Failed to precisely describe the version via Git -- using the default version string

这是可能是git需要联网下载更新失败而出现的错误,无视之。

执行make,出现如下错误信息:

processwrapper.cc: In static member function ‘static unsigned int ProcessWrapper::currentProcessId()’:
processwrapper.cc:99:19: error: ‘getpid’ was not declared in this scope
processwrapper.cc:100:1: warning: control reaches end of non-void function [-Wreturn-type]
make: *** [build/processwrapper.o] Error 1

执行如下命令:
grep -r "getpid" *
输出信息如下:

processwrapper.cc:    returngetpid();

只找到了一个源文件中包含getpid,说明getpid是系统环境中的。

通过搜索"getpid was not declared in this scope",发现getpid在/usr/include/unistd.h这个头文件中,
于是通过分析processwrapper.cc,在这个源文件中的"#else"后添加"#include <unistd.h>"(注意添加到源文件中时不要带引号)。

再次执行make,又出现如下错误信息:

qtsingleapplication/src/qtlocalpeer.cpp: In constructor ‘QtLocalPeer::QtLocalPeer(QObject*, const QString&)’:
qtsingleapplication/src/qtlocalpeer.cpp:96:54: error: ‘::getuid’ has not been declared
qtsingleapplication/src/qtlocalpeer.cpp:96:54: note: suggested alternative:
In file included from qtsingleapplication/src/qtlockedfile_unix.cpp:42:0,
                 from qtsingleapplication/src/qtlocalpeer.cpp:60:
/usr/include/unistd.h:697:16: note:   ‘QtLP_Private::getuid’
make: *** [build/qtlocalpeer.o] Error 1

通过分析qtsingleapplication/src/qtlocalpeer.cpp,在这个源文件中的"#include <time.h>"后添加"#include <unistd.h>"(注意添加到源文件中时不要带引号)。

再执行make,编译通过了。

然后就是执行make install了。

安装完后,发现程序菜单中的GoldenDict没有图标,
执行vim /usr/local/share/applications/goldendict.desktop,
发现Icon=/usr/share/pixmaps/goldendict.png指定的png文件不存在,
执行ll /usr/local/share/pixmaps/goldendict.png,发现png文件原来在这,
于是修改为Icon=/usr/local/share/pixmaps/goldendict.png,
程序菜单中的GoldenDict就有图标了。

PS:不知道为什么GoldenDict使用词典需要执行权限,安装词典时,如果词典放在了/usr/local/share等非root用户有权限限制的地方,需要使用如下命令为词典文件添加执行权限:
chmod -R 755 dictionaries

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值