SDCV installation in CYGWIN

8 篇文章 0 订阅

Software versions: Windows 8 Pro, Cygwin 1.7.17, gcc 3.4.4 (cygming special) and SDCV 0.4.2


SDCV [1] is the Command-line (Console) Version of StarDict dictionary. The installation procedures are listed below.


1. Downloading

Download the release from the SDCV Home Page [2]. Unpack the tarball,

tar -xvf sdcv-0.4.2.tar.bz2

See the INSTALL file for installation steps, which will be explained in detail next.


2. Configuration

Run the following scripts:

cd sdcv-0.4.2
./configure

Missing libraries, such as zlib, pkg-config, and glib-2.0 should be installed in advance. It may be easier to use apt-cyg [3] than the setup.exe to perform the installation.

In the following source compiling step, one may find that the provided configuration file can lead to various errors. Troubleshootings are provided.


3. Compiling

Run "make" to compile the sources. During the compilation, some errors may occur.

(1) mapfile.hpp:28: error [4]

The error seems to be caused by the MMAP problem on Cywin [5]. The solution is to replace AC_FUNC_MMAP with AC_CHECK_FUNCS(mmap) in the "configure.ac" file.

After this modification, run "autoconf" and "make" again.

(2) locale.h:62: error: `libintl_setlocale' is not a member of `std' [6]

The error is because of incorrect orders of heading files in "src/sdcv.cpp". Just put C++ headers <string>, <vector>, and <memory> before the three glib headers, then problem solved.

(3) lib/libstardict.a(lib.o) problem [4]

"Seemly ar does not work on current cygwin" [4] [5]. The original command line is:

g++ -g -O2 -o sdcv.exe sdcv.o getopt.o getopt1.o libwrapper.o readline.o utils.o -lglib-2.0 -lintl -liconv -lpcre lib/libstardict.a -lz

Change the command line to:

cd sdcv-0.4.2/src/
g++ -g -O2 -o sdcv.exe sdcv.o getopt.o getopt1.o libwrapper.o readline.o utils.o lib/*.o -lglib-2.0 -lintl -liconv -lpcre -lz

Then sdcv.exe is generated, and it works.

Run the self-tests optionally, by typing "make check"


4. Installation

Run the script below to install the programs, data files and documentation.

make install

The program sdcv.exe is installed in /usr/local/bin/.


5. Adding dictionary files

Download dictionary files from [8] [9] [10]. Unpack and put them into the stardict directory, where sdcv looks for dictionaries when invoked [11] [12].

mkdir /usr/share/stardict/dic/
tar -xvjf downloaded.tar.bz2 -C /usr/share/stardict/dic
(or tar -xvzf downloaded.tar.gz -C /usr/share/stardict/dic)

Some dictionaries are marked "recommended" on the website. Seems that there are some copyright issues though.


6. Using SDCV

sdcv [list of words]

Use "man sdcv" for more detailed user manual.


===========

References:

[1] http://en.wikipedia.org/wiki/Sdcv

[2] http://sdcv.sourceforge.net/

[3] http://blog.csdn.net/lllcfr1/article/details/8669885

[4] http://sourceforge.net/tracker/?func=detail&aid=1585638&group_id=122858&atid=694731

[5] http://nanjj.blogspot.hk/2007/03/sdcvcygwin.html

[6] http://sourceforge.net/tracker/?func=detail&aid=3276858&group_id=122858&atid=694728

[7] https://trac.macports.org/browser/trunk/dports/textproc/sdcv/files/patch-setlocale.diff?rev=85010

[8] http://www.stardict.org/

[9] http://code.google.com/p/stardict-3/wiki/DownloadDictionaries

[10] http://abloz.com/huzheng/stardict-dic/

[11] http://renwolang521.iteye.com/blog/1317789

[12] http://flossstuff.wordpress.com/2012/01/23/sdcv-command-line-based-dictionary-for-linux/


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值