修改星际译王stardict代码,恢复google全文翻译功能(附修改源码)

OOo,TeX,KO,ABI,GIMP,Picasa,ProE,QCAD,Inkscape,Kicad,Eagle
xiujie
帖子: 12
注册时间: 2008-09-22 16:01

修改星际译王stardict代码,恢复google全文翻译功能(附修改源码)

#1

帖子 xiujie » 2009-10-30 13:03

最近又重新回到linux怀抱了。linux 中好用的词典只有星际译王 stardict 了。使用中发现全文翻译google不能用了。我一直都是用google的,用别的很习惯。想修改它的源代码试试,看看能不能解决这个问题,没有想到解决了。
下载stardict 源代码
修改mainwin.cpp中

代码: 全选

static const char *google_fromlangs[] = {N_("Arabic"), N_("Chinese"), N_("Chinese (Simplified)"), N_("Chinese (Traditional)"), N_("English"), N_("French"), N_("German"), N_("Italian"), N_("Japanese"), N_("Korean"), N_("Portuguese"), N_("Russian"), N_("Spanish"), NULL};
static const char *google_arabic_tolangs[] = { N_("English"), NULL };
static const char *google_arabic_code[] = { "ar&tl=en" };
static const char *google_chinese_tolangs[] = { N_("English"), NULL };
static const char *google_chinese_code[] = { "zh-CN&tl=en" };
static const char *google_chinese_simplified_tolangs[] = {N_("Chinese (Traditional)"), N_("English"), NULL };
static const char *google_chinese_simplified_code[] = { "zh-CN&tl=zh-TW", "zh-CN&tl=en" };
static const char *google_chinese_traditional_tolangs[] = {N_("Chinese (Simplified)"), N_("English"), NULL };
static const char *google_chinese_traditional_code[] = { "zh-TW&tl=zh-CN", "zh-TW&tl=en" };
static const char *google_english_tolangs[] = { N_("Arabic"), N_("Chinese (Simplified)"), N_("Chinese (Traditional)"), N_("French"), N_("German"), N_("Italian"), N_("Japanese"), N_("Korean"), N_("Portuguese"), N_("Russian"), N_("Spanish"), NULL };
static const char *google_english_code[] = {"en&tl=ar", "en&tl=zh-CN", "en&tl=zh-TW", "en&tl=fr", "en&tl=de", "en&tl=it", "en&tl=ja", "en&tl=ko", "en&tl=pt", "en&tl=ru", "en&tl=es"};
static const char *google_french_tolangs[] = { N_("English"), N_("German"), NULL };
static const char *google_french_code[] = { "fr&tl=en", "fr&tl=de" };
static const char *google_german_tolangs[] = {N_("English"), N_("French"), NULL};
static const char *google_german_code[] = { "de&tl=en", "de&tl=fr" };
static const char *google_italian_tolangs[] = {N_("English"), NULL};
static const char *google_italian_code[] = { "it&tl=en" };
static const char *google_japanese_tolangs[] = {N_("English"), NULL};
static const char *google_japanese_code[] = { "ja&tl=en" };
static const char *google_korean_tolangs[] = {N_("English"), NULL};
static const char *google_korean_code[] = { "ko&tl=en" };
static const char *google_portuguese_tolangs[] = {N_("English"), NULL};
static const char *google_portuguese_code[] = { "pt&tl=en" };
static const char *google_russian_tolangs[] = {N_("English"), NULL};
static const char *google_russian_code[] = { "ru&tl=en" };
static const char *google_spanish_tolangs[] = {N_("English"), NULL};
static const char *google_spanish_code[] = { "es&tl=en" };

代码: 全选

void TransWin::GetHostFile(std::string &host, std::string &file, const char *text)
{
	gint engine_index = gtk_combo_box_get_active(GTK_COMBO_BOX(engine_combobox));
	if(engine_index==0){
		host = "translate.google.cn";
		file = "/translate_t?prev=hp&hl=zh-CN&js=y&sl=";
	}else if(engine_index==1){
		host = "fanyi.cn.yahoo.com";
		file = "/translate_txt?ei=UTF-8&lp=";
	}else if(engine_index==2){
		host = "babelfish.altavista.com";
		file = "/tr?ienc=utf-8&lp=";
	}else if(engine_index==3){
		host = "www.systranbox.com";
		file = "/systran/box?systran_id=SystranSoft-en&systran_charset=UTF-8&systran_lp=";
	}else if(engine_index==4){
		host = "www.excite.co.jp";
		file = "/world";
	}else if(engine_index==5){
		host = "fy.iciba.com";
		file = "/?langpair=";
	}

	gint fromlang_index = gtk_combo_box_get_active(GTK_COMBO_BOX(fromlang_combobox));
	gint tolang_index = gtk_combo_box_get_active(GTK_COMBO_BOX(tolang_combobox));
	const char *lang_code = trans_engines[engine_index].code[fromlang_index][tolang_index];
	if(engine_index==4){
		if(strcmp(lang_code,"KOJA")==0 || strcmp(lang_code,"JAKO")==0){
			file += "/korean?wb_lp=";
		}else if(strcmp(lang_code,"ENJA")==0 || strcmp(lang_code,"JAEN")==0){
			file += "/english?wb_lp=";
		}else if(strcmp(lang_code,"CHJA")==0 || strcmp(lang_code,"JACH")==0){
			file += "/chinese?wb_lp=";
		}else{
			file += "/english?wb_lp=";
		}
	}
  
	file += lang_code;
	if (engine_index == 0) {
		file += "&text=";
		file += text;
	} else if (engine_index == 1){
		file += "&text=";
		file += text;
	} else if (engine_index == 2){
		file += "&trtext=";
		file += text;
	}else if(engine_index == 3 ){
		file += "&systran_text=";
		file += text;
	}else if(engine_index == 4 ){
		file += "&before=";
		file += text;
	}
}
修改stardict.cpp文件中

代码: 全选

	} else if (engine_index == 0) {
		//#define GoogleTranslateStartMark "<div id=result_box dir=ltr>"
        #define GoogleTranslateStartMark "<textarea name=utrans wrap=SOFT dir=\"ltr\" rows=5 id=suggestion>"
                                //<textarea name=utrans wrap=SOFT dir="ltr" rows=5 id=suggestion>
		char *p = g_strstr_len(buffer, buffer_len, GoogleTranslateStartMark);
		if (p) {
			p += sizeof(GoogleTranslateStartMark) -1;
			char *p2 = g_strstr_len(p, buffer_len - (p - buffer), "</textarea>");
			if (p2) {
				result_text.assign(p, p2-p);
				found = true;
			}
		}
	}
下载修改后的全部源码:
http://www.brsbox.com/filebox/down/fc/86e4548789d625fa5592ffb2abc895a1
下载地址2
http://xiujiecn.qupan.com/5018378.html
如何用gcc/g++编译

代码: 全选

./configure PKG_CONFIG=/usr/bin/pkg-config --prefix=/usr --sysconfdir=/etc --mandir=/usr/share/man --disable-gnome-support --disable-schemas-install --disable-espeak --disable-gucharmap --disable-festival --disable-advertisement --disable-updateinfo --disable-spell


make
如何安装

代码: 全选

sudo make install
风间星魂
帖子: 490
注册时间: 2009-06-20 23:53

Re: 修改星际译王stardict代码,恢复google全文翻译功能(附修改源码)

#2

帖子 风间星魂 » 2009-11-03 22:34

感谢楼主!不妨提交问题给官方? :em11
头像
xrb2007
帖子: 558
注册时间: 2009-02-14 9:04

Re: 修改星际译王stardict代码,恢复google全文翻译功能(附修改源码)

#3

帖子 xrb2007 » 2009-11-11 17:18

xiujie 写了:最近又重新回到linux怀抱了。linux 中好用的词典只有星际译王 stardict 了。使用中发现全文翻译google不能用了。我一直都是用google的,用别的很习惯。想修改它的源代码试试,看看能不能解决这个问题,没有想到解决了。
下载stardict 源代码
修改mainwin.cpp中

代码: 全选

static const char *google_fromlangs[] = {N_("Arabic"), N_("Chinese"), N_("Chinese (Simplified)"), N_("Chinese (Traditional)"), N_("English"), N_("French"), N_("German"), N_("Italian"), N_("Japanese"), N_("Korean"), N_("Portuguese"), N_("Russian"), N_("Spanish"), NULL};
static const char *google_arabic_tolangs[] = { N_("English"), NULL };
static const char *google_arabic_code[] = { "ar&tl=en" };
static const char *google_chinese_tolangs[] = { N_("English"), NULL };
static const char *google_chinese_code[] = { "zh-CN&tl=en" };
static const char *google_chinese_simplified_tolangs[] = {N_("Chinese (Traditional)"), N_("English"), NULL };
static const char *google_chinese_simplified_code[] = { "zh-CN&tl=zh-TW", "zh-CN&tl=en" };
static const char *google_chinese_traditional_tolangs[] = {N_("Chinese (Simplified)"), N_("English"), NULL };
static const char *google_chinese_traditional_code[] = { "zh-TW&tl=zh-CN", "zh-TW&tl=en" };
static const char *google_english_tolangs[] = { N_("Arabic"), N_("Chinese (Simplified)"), N_("Chinese (Traditional)"), N_("French"), N_("German"), N_("Italian"), N_("Japanese"), N_("Korean"), N_("Portuguese"), N_("Russian"), N_("Spanish"), NULL };
static const char *google_english_code[] = {"en&tl=ar", "en&tl=zh-CN", "en&tl=zh-TW", "en&tl=fr", "en&tl=de", "en&tl=it", "en&tl=ja", "en&tl=ko", "en&tl=pt", "en&tl=ru", "en&tl=es"};
static const char *google_french_tolangs[] = { N_("English"), N_("German"), NULL };
static const char *google_french_code[] = { "fr&tl=en", "fr&tl=de" };
static const char *google_german_tolangs[] = {N_("English"), N_("French"), NULL};
static const char *google_german_code[] = { "de&tl=en", "de&tl=fr" };
static const char *google_italian_tolangs[] = {N_("English"), NULL};
static const char *google_italian_code[] = { "it&tl=en" };
static const char *google_japanese_tolangs[] = {N_("English"), NULL};
static const char *google_japanese_code[] = { "ja&tl=en" };
static const char *google_korean_tolangs[] = {N_("English"), NULL};
static const char *google_korean_code[] = { "ko&tl=en" };
static const char *google_portuguese_tolangs[] = {N_("English"), NULL};
static const char *google_portuguese_code[] = { "pt&tl=en" };
static const char *google_russian_tolangs[] = {N_("English"), NULL};
static const char *google_russian_code[] = { "ru&tl=en" };
static const char *google_spanish_tolangs[] = {N_("English"), NULL};
static const char *google_spanish_code[] = { "es&tl=en" };

代码: 全选

void TransWin::GetHostFile(std::string &host, std::string &file, const char *text)
{
	gint engine_index = gtk_combo_box_get_active(GTK_COMBO_BOX(engine_combobox));
	if(engine_index==0){
		host = "translate.google.cn";
		file = "/translate_t?prev=hp&hl=zh-CN&js=y&sl=";
	}else if(engine_index==1){
		host = "fanyi.cn.yahoo.com";
		file = "/translate_txt?ei=UTF-8&lp=";
	}else if(engine_index==2){
		host = "babelfish.altavista.com";
		file = "/tr?ienc=utf-8&lp=";
	}else if(engine_index==3){
		host = "www.systranbox.com";
		file = "/systran/box?systran_id=SystranSoft-en&systran_charset=UTF-8&systran_lp=";
	}else if(engine_index==4){
		host = "www.excite.co.jp";
		file = "/world";
	}else if(engine_index==5){
		host = "fy.iciba.com";
		file = "/?langpair=";
	}

	gint fromlang_index = gtk_combo_box_get_active(GTK_COMBO_BOX(fromlang_combobox));
	gint tolang_index = gtk_combo_box_get_active(GTK_COMBO_BOX(tolang_combobox));
	const char *lang_code = trans_engines[engine_index].code[fromlang_index][tolang_index];
	if(engine_index==4){
		if(strcmp(lang_code,"KOJA")==0 || strcmp(lang_code,"JAKO")==0){
			file += "/korean?wb_lp=";
		}else if(strcmp(lang_code,"ENJA")==0 || strcmp(lang_code,"JAEN")==0){
			file += "/english?wb_lp=";
		}else if(strcmp(lang_code,"CHJA")==0 || strcmp(lang_code,"JACH")==0){
			file += "/chinese?wb_lp=";
		}else{
			file += "/english?wb_lp=";
		}
	}
  
	file += lang_code;
	if (engine_index == 0) {
		file += "&text=";
		file += text;
	} else if (engine_index == 1){
		file += "&text=";
		file += text;
	} else if (engine_index == 2){
		file += "&trtext=";
		file += text;
	}else if(engine_index == 3 ){
		file += "&systran_text=";
		file += text;
	}else if(engine_index == 4 ){
		file += "&before=";
		file += text;
	}
}
修改stardict.cpp文件中

代码: 全选

	} else if (engine_index == 0) {
		//#define GoogleTranslateStartMark "<div id=result_box dir=ltr>"
        #define GoogleTranslateStartMark "<textarea name=utrans wrap=SOFT dir=\"ltr\" rows=5 id=suggestion>"
                                //<textarea name=utrans wrap=SOFT dir="ltr" rows=5 id=suggestion>
		char *p = g_strstr_len(buffer, buffer_len, GoogleTranslateStartMark);
		if (p) {
			p += sizeof(GoogleTranslateStartMark) -1;
			char *p2 = g_strstr_len(p, buffer_len - (p - buffer), "</textarea>");
			if (p2) {
				result_text.assign(p, p2-p);
				found = true;
			}
		}
	}
下载修改后的全部源码:
http://www.brsbox.com/filebox/down/fc/8 ... b2abc895a1
下载地址2
http://xiujiecn.qupan.com/5018378.html
如何用gcc/g++编译

代码: 全选

./configure PKG_CONFIG=/usr/bin/pkg-config --prefix=/usr --sysconfdir=/etc --mandir=/usr/share/man --disable-gnome-support --disable-schemas-install --disable-espeak --disable-gucharmap --disable-festival --disable-advertisement --disable-updateinfo --disable-spell


make
如何安装

代码: 全选

sudo make install

下载你的代码后,如何安装?
ubuntu 小a中文论坛技术版块 http://www.avast1.cn/bbs/forum-80-1.html

我的新浪博客 http://blog.sina.com.cn/xieruibiao
头像
xrb2007
帖子: 558
注册时间: 2009-02-14 9:04

Re: 修改星际译王stardict代码,恢复google全文翻译功能(附修改源码)

#4

帖子 xrb2007 » 2009-11-11 17:19

xrb2007@xrb2007-laptop:~$ sudo make install
make: *** 没有规则可以创建目标“install”。 停止。
xrb2007@xrb2007-laptop:~$
ubuntu 小a中文论坛技术版块 http://www.avast1.cn/bbs/forum-80-1.html

我的新浪博客 http://blog.sina.com.cn/xieruibiao
头像
xrb2007
帖子: 558
注册时间: 2009-02-14 9:04

Re: 修改星际译王stardict代码,恢复google全文翻译功能(附修改源码)

#5

帖子 xrb2007 » 2009-11-11 18:18

:em20 看不懂,搞了下,还是不懂。
ubuntu 小a中文论坛技术版块 http://www.avast1.cn/bbs/forum-80-1.html

我的新浪博客 http://blog.sina.com.cn/xieruibiao
xiujie
帖子: 12
注册时间: 2008-09-22 16:01

Re: 修改星际译王stardict代码,恢复google全文翻译功能(附修改源码)

#6

帖子 xiujie » 2009-11-12 14:12

xrb2007 写了::em20 看不懂,搞了下,还是不懂。
第一步
./configure PKG_CONFIG=/usr/bin/pkg-config --prefix=/usr --sysconfdir=/etc --mandir=/usr/share/man --disable-gnome-support --disable-schemas-install --disable-espeak --disable-gucharmap --disable-festival --disable-advertisement --disable-updateinfo --disable-spell
第二步
make
第三步
sudo make install
头像
xrb2007
帖子: 558
注册时间: 2009-02-14 9:04

Re: 修改星际译王stardict代码,恢复google全文翻译功能(附修改源码)

#7

帖子 xrb2007 » 2009-11-12 14:34

xrb2007@xrb2007-laptop:~$ stardict-3.0.1_bbs.xiujie.cn
stardict-3.0.1_bbs.xiujie.cn: command not found
xrb2007@xrb2007-laptop:~$ cd stardict-3.0.1_bbs.xiujie.cn
xrb2007@xrb2007-laptop:~/stardict-3.0.1_bbs.xiujie.cn$ ./configure PKG_CONFIG=/usr/bin/pkg-config --prefix=/usr --sysconfdir=/etc --mandir=/usr/share/man --disable-gnome-support --disable-schemas-install --disable-espeak --disable-gucharmap --disable-festival --disable-advertisement --disable-updateinfo --disable-spell
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for gconftool-2... /usr/bin/gconftool-2
checking for style of include used by make... GNU
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking for intltool >= 0.22... 0.36.2 found
checking for perl... /usr/bin/perl
checking for XML::Parser... ok
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking for g++... no
checking for c++... no
checking for gpp... no
checking for aCC... no
checking for CC... no
checking for cxx... no
checking for cc++... no
checking for cl.exe... no
checking for FCC... no
checking for KCC... no
checking for RCC... no
checking for xlC_r... no
checking for xlC... no
checking whether we are using the GNU C++ compiler... no
checking whether g++ accepts -g... no
checking dependency style of g++... none
checking for g77... no
checking for xlf... no
checking for f77... no
checking for frt... no
checking for pgf77... no
checking for cf77... no
checking for fort77... no
checking for fl32... no
checking for af77... no
checking for xlf90... no
checking for f90... no
checking for pgf90... no
checking for pghpf... no
checking for epcf90... no
checking for gfortran... no
checking for g95... no
checking for xlf95... no
checking for f95... no
checking for fort... no
checking for ifort... no
checking for ifc... no
checking for efc... no
checking for pgf95... no
checking for lf95... no
checking for ftn... no
checking whether we are using the GNU Fortran 77 compiler... no
checking whether accepts -g... no
checking the maximum length of command line arguments... 1572864
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC
checking if gcc PIC flag -fPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
configure: creating libtool
appending configuration tag "CXX" to libtool
appending configuration tag "F77" to libtool
checking for library containing strerror... none required
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking dependency style of gcc... (cached) gcc3
checking whether we are using the GNU C++ compiler... (cached) no
checking whether g++ accepts -g... (cached) no
checking dependency style of g++... (cached) none
checking for a BSD-compatible install... /usr/bin/install -c
checking whether make sets $(MAKE)... (cached) yes
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking for getpagesize... no
checking for working mmap... no
checking locale.h usability... no
checking locale.h presence... no
checking for locale.h... no
checking libintl.h usability... no
checking libintl.h presence... no
checking for libintl.h... no
checking for STARDICT... configure: error: Package requirements (gtk+-2.0 >= 2.12 gthread-2.0) were not met:

No package 'gtk+-2.0' found
No package 'gthread-2.0' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables STARDICT_CFLAGS
and STARDICT_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

xrb2007@xrb2007-laptop:~/stardict-3.0.1_bbs.xiujie.cn$ make
make: *** 没有指明目标并且找不到 makefile。 停止。
xrb2007@xrb2007-laptop:~/stardict-3.0.1_bbs.xiujie.cn$ sudo make install
[sudo] password for xrb2007:
make: *** 没有规则可以创建目标“install”。 停止。
xrb2007@xrb2007-laptop:~/stardict-3.0.1_bbs.xiujie.cn$
ubuntu 小a中文论坛技术版块 http://www.avast1.cn/bbs/forum-80-1.html

我的新浪博客 http://blog.sina.com.cn/xieruibiao
头像
daf3707
论坛版主
帖子: 12731
注册时间: 2007-06-13 15:57
来自: 在他乡

Re: 修改星际译王stardict代码,恢复google全文翻译功能(附修改源码)

#8

帖子 daf3707 » 2009-11-12 14:41

有没有人打包?
头像
xrb2007
帖子: 558
注册时间: 2009-02-14 9:04

Re: 修改星际译王stardict代码,恢复google全文翻译功能(附修改源码)

#9

帖子 xrb2007 » 2009-11-12 17:09

daf3707 写了:有没有人打包?

:em05 也是我的心里话。
ubuntu 小a中文论坛技术版块 http://www.avast1.cn/bbs/forum-80-1.html

我的新浪博客 http://blog.sina.com.cn/xieruibiao
yangyang22
帖子: 2
注册时间: 2009-07-13 10:46

Re: 修改星际译王stardict代码,恢复google全文翻译功能(附修改源码)

#10

帖子 yangyang22 » 2009-11-18 11:10

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for gconftool-2... /usr/bin/gconftool-2
checking for style of include used by make... GNU
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking for intltool >= 0.22... 0.36.2 found
checking for perl... /usr/bin/perl
checking for XML::Parser... ok
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking how to run the C++ preprocessor... g++ -E
checking for g77... no
checking for xlf... no
checking for f77... no
checking for frt... no
checking for pgf77... no
checking for cf77... no
checking for fort77... no
checking for fl32... no
checking for af77... no
checking for xlf90... no
checking for f90... no
checking for pgf90... no
checking for pghpf... no
checking for epcf90... no
checking for gfortran... no
checking for g95... no
checking for xlf95... no
checking for f95... no
checking for fort... no
checking for ifort... no
checking for ifc... no
checking for efc... no
checking for pgf95... no
checking for lf95... no
checking for ftn... no
checking whether we are using the GNU Fortran 77 compiler... no
checking whether accepts -g... no
checking the maximum length of command line arguments... 1572864
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC
checking if gcc PIC flag -fPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
configure: creating libtool
appending configuration tag "CXX" to libtool
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC
checking if g++ PIC flag -fPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
appending configuration tag "F77" to libtool
checking for library containing strerror... none required
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking dependency style of gcc... (cached) gcc3
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether g++ accepts -g... (cached) yes
checking dependency style of g++... (cached) gcc3
checking for a BSD-compatible install... /usr/bin/install -c
checking whether make sets $(MAKE)... (cached) yes
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking for getpagesize... yes
checking for working mmap... yes
checking locale.h usability... yes
checking locale.h presence... yes
checking for locale.h... yes
checking for LC_MESSAGES... yes
checking libintl.h usability... yes
checking libintl.h presence... yes
checking for libintl.h... yes
checking for ngettext in libc... yes
checking for dgettext in libc... yes
checking for bind_textdomain_codeset... yes
checking for msgfmt... no
checking for STARDICT... configure: error: Package requirements (gtk+-2.0 >= 2.12 gthread-2.0) were not met:

No package 'gtk+-2.0' found
No package 'gthread-2.0' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables STARDICT_CFLAGS
and STARDICT_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

还请高手帮忙解决以上问题,感谢!
头像
Jarson
帖子: 2371
注册时间: 2008-07-21 9:44
来自: 深圳
联系:

Re: 修改星际译王stardict代码,恢复google全文翻译功能(附修改源码)

#11

帖子 Jarson » 2009-11-18 14:05

回10楼,估计是你的系统上缺少gtk相关的库文件,把gtk库安装上去再编译安装试试

代码: 全选

sudo apt-get install libgtk2.0-dev
头像
jimmyxu
帖子: 335
注册时间: 2009-11-16 0:30
来自: sh
联系:

Re: 修改星际译王stardict代码,恢复google全文翻译功能(附修改源码)

#12

帖子 jimmyxu » 2009-11-18 15:45

谢谢了,下下来试试看了!!
只有历经,才能懂得!!
yangyang22
帖子: 2
注册时间: 2009-07-13 10:46

Re: 修改星际译王stardict代码,恢复google全文翻译功能(附修改源码)

#13

帖子 yangyang22 » 2009-11-20 9:44

已经成功安装,可GOOGLE全文还是不能链接?????
头像
xrb2007
帖子: 558
注册时间: 2009-02-14 9:04

Re: 修改星际译王stardict代码,恢复google全文翻译功能(附修改源码)

#14

帖子 xrb2007 » 2009-11-20 11:21

yangyang22 写了:已经成功安装,可GOOGLE全文还是不能链接?????

google翻译的网页又改版了,是不是因为这个原因呢?
ubuntu 小a中文论坛技术版块 http://www.avast1.cn/bbs/forum-80-1.html

我的新浪博客 http://blog.sina.com.cn/xieruibiao
头像
win.milan
帖子: 908
注册时间: 2009-11-03 16:24

Re: 修改星际译王stardict代码,恢复google全文翻译功能(附修改源码)

#15

帖子 win.milan » 2009-11-20 11:32

10楼的编译出错,明显是缺少东西嘛。
OMG, this is a signature!—_—|
FollowMe......
回复