Ubuntu10.10如何安裝背單詞軟件Reciteword?
Ubuntu系統(tǒng)擁有強大的功能、實用的界面和完全免費的特點吸引了許多用戶的使用,Ubuntu也相當(dāng)注重系統(tǒng)的易用性,標(biāo)準(zhǔn)安裝完成后,一開機就可以投入使用,簡單地說,就是安裝完成以后,用戶無需再費神安裝瀏覽器、Office套裝程序、多媒體播放程序等常用軟件,一般也無需下載安裝網(wǎng)卡、聲卡等硬件設(shè)備的驅(qū)動。Reciteword是一款中文界面的背單詞軟件(也稱黑客背單詞),功能比較強大。在Ubuntu中安裝可能會遇到一些小困難,故在此說明一下。
本文介紹的是從源碼編譯安裝的過程。
Table of Contents
1 下載及安裝(轉(zhuǎn)載部分)
1.1 下載程序
1.2 準(zhǔn)備工具
1.3 黑客背單詞的安裝
2 遇到的編譯錯誤
3 問題解決
1 下載及安裝(轉(zhuǎn)載部分)
1.1 下載程序
reciteword的網(wǎng)站是:http://reciteword.cosoft.org.cn/reciteword/index.html
作者提供了如下幾個包,請按需下載源碼包:
主程序源碼(必須) reciteword
課本(重要) reciteword-books
詞典(可選) reciteword-dicts
皮膚(可選) reciteword-skins-rw
真人發(fā)音 WyabdcRealPeopleTTS (可選,是stardict的真人語音)
1.2 準(zhǔn)備工具
先安裝編譯需要的包
- apt-get install libesd0-dev pkg-config libgtk2.0-dev esound
如果是Ubuntu 8.04版本,安裝時可能會出現(xiàn)刪除pulseaudio-esound-compat,ubuntu-desktop這兩個文件,請之后再安裝回去,如果不安裝,進入桌面后桌面不成正常使用,我的方法是重啟后按ctrl+alt+f1,進入控制臺,打入以下命令:
sudo apt-get install Ubuntu-desktop就會安裝這兩個文件,www.linuxidc.com重啟后正常 安裝libesd0-alsa0,保證開啟esd後,仍能用alsa。
apt-get install libesd-alsa0啟用esd,這是reciteword播放聲音所必須的:(假設(shè)是gnome環(huán)境)
在菜單中:系統(tǒng)->首選項->音效,在打開的窗口中:音效->允許軟件混音(ESD)。
為了使設(shè)置生效,建議你最好重新啟動系統(tǒng)。
1.3 黑客背單詞的安裝
安裝過程就沒有什么特別的了,進入存有reciteword的文件后:
- tar -xvfj reciteword-*.tar.bz2
- cd reciteword-0.*
- ./configure –prefix=/usr
- make
- sudo make install
2 遇到的編譯錯誤
Ubuntu會出現(xiàn)這樣編譯出錯:
- 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
3 問題解決
- bookfile.cpp:95: error: invalid conversion from ‘const char*’ to ‘gchar*
根據(jù)以上錯誤找到 bookfile.cpp 在頭文件處加上兩句代碼
#include "bookfile.h" #include #include #include #include #include const gchar* str1; const gchar* str2 = strchr(str1, 'a');再找到函數(shù) (大概在90行里) static gchar * rw_book_get_value (const gchar * str1, gchar * str2,gint utf8) -----------------------------------------------------把原來的 tmp1 = strstr (str1, str2);改為 tmp1 = (gchar*)strstr (str1, str2);
經(jīng)過上面的改動 再編譯即可
相同問題請參考 http://gcc.gnu.org/gcc-4.4/porting_to.html
訪問: http://ljp.9t9t.info
- Author: Li Junpeng
- Date: 2010-10-30 23:34:45 CST
- HTML generated by org-mode 6.21b in emacs 23
總結(jié):
希望本文介紹的Ubuntu10.10安裝背單詞軟件Reciteword的方法能夠?qū)ψx者有所幫助,更多有關(guān)linux系統(tǒng)的知識還有待于讀者去探索和學(xué)習(xí)。
【編輯推薦】