reciteword的网站是: http://reciteword.sourceforge.net/
作者提供了如下几个包,请按需下载源码包:
主程序源码(必须) reciteword
先安装编译需要的包
apt-get install libesd0-dev pkg-config libgtk2.0-dev esound
如果是ubuntu8.04版本,安装时可能会出现删除pulseaudio-esound-compat,ubuntu-desktop这两个文件
,请之后再安装回去,如果不安装,进入桌面后桌面不成正常使用,我的方法是重启后按ctrl+alt+f1,进入控制台,打入以下命令:
sudo apt-get install ubuntu-desktop就会安装这两个文件,重启后正常 安装libesd0-alsa0,保证开启esd後,仍能用alsa。
apt-get install libesd-alsa0启用esd,这是reciteword播放声音所必须的:(假设是gnome环境)
在菜单中:系统->首选项->音效,在打开的窗口中:音效->允许软件混音(ESD)。
为了使设置生效,建议你最好重新启动系统。
安装过程就没有什么特别的了,进入存有reciteword的文件后:
tar -xvfj reciteword-*.tar.bz2
cd reciteword-0.*
./configure –prefix=/usr (如果是UBUNTU11.10的话,先sudo apt-get install libxml-parser-perl )
make
sudo make install
ubuntu会出现这样编译出错
bookfile.cpp: In function ‘gchar* rw_book_get_value(const gchar*, gchar*, gint)’: bookfile.cpp:95: error: invalid conversion from ‘const char*’ to ‘gchar*’ bookfile.cpp: In function ‘gint rw_book_get_file_info(gchar*, gchar**, gchar**, gchar**, gchar**, gchar**, gchar**)’: bookfile.cpp:140: warning: deprecated conversion from string constant to ‘gchar*’ bookfile.cpp:153: warning: deprecated conversion from string constant to ‘gchar*’ bookfile.cpp:154: warning: deprecated conversion from string constant to ‘gchar*’ bookfile.cpp:155: warning: deprecated conversion from string constant to ‘gchar*’ bookfile.cpp:156: warning: deprecated conversion from string constant to ‘gchar*’ bookfile.cpp:157: warning: deprecated conversion from string constant to ‘gchar*’ bookfile.cpp: In function ‘BookFile* rw_book_open_file(gchar*)’: bookfile.cpp:228: warning: deprecated conversion from string constant to ‘gchar*’ bookfile.cpp:229: warning: deprecated conversion from string constant to ‘gchar*’ bookfile.cpp:230: warning: deprecated conversion from string constant to ‘gchar*’ bookfile.cpp:231: warning: deprecated conversion from string constant to ‘gchar*’ bookfile.cpp:232: warning: deprecated conversion from string constant to ‘gchar*’ bookfile.cpp:233: warning: deprecated conversion from string constant to ‘gchar*’ bookfile.cpp:209: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result make[3]: *** [bookfile.o] 错误 1 make[3]:正在离开目录 `/tmp/word/reciteword-0.8.4/src' make[2]: *** [all-recursive] 错误 1 make[2]:正在离开目录 `/tmp/word/reciteword-0.8.4/src' make[1]: *** [all-recursive] 错误 1 make[1]:正在离开目录 `/tmp/word/reciteword-0.8.4' make: *** [all] 错误 2
bookfile.cpp:95: error: invalid conversion from ‘const char*’ to ‘gchar*
根据以上错误找到 bookfile.cpp 在头文件处加上两句代码
#include "bookfile.h" #include <cstring> #include <cstdio> #include <sys/stat.h> #include <fstream> #include <string> const gchar* str1; const gchar* str2 = strchr(str1, 'a'); 再找到函数 (大概在90行里) static gchar * rw_book_get_value (const gchar * str1, gchar * str2,gint utf8) ----------------------------------------------------- 把原来的 tmp1 = strstr (str1, str2); 改为 tmp1 = (gchar*)strstr (str1, str2);
经过上面的改动 再编译即可