Ubuntu下Ibus输入平台安装SunPinYin步骤及出现的系列问题解决方案
Ubuntu默认自带的是ibus输入平台,提供一个叫pinyin的输入法。本人不是很喜欢用,听说SunPinYin不错,就安装了试试!!!(请参考这里)
step 1:下载安装输入法
下载地址:http://code.google.com/p/sunpinyin/downloads/list
下载最新的两个包:sunpinyin-2.0.3.tar.gz,ibus-sunpinyin-2.0.3.tar.gz
step2:安装依赖组件
C++编译器 (sudo aptitude install build-essential)
sqlite3 (sudo apt-get install sqlite3 libsqlite3-dev)
SCons (sudo apt-get install scons)
step3:安装输入法引擎
1) 使用sudo tar -zxvf sunpinyin-2.0.3.tar.gz 解压sunpinyin-2.0.3.tar.gz。进入该目录
2) 使用scons --prefix=/usr 进行编译(--prefix=/usr表示将文件安装到/usr,默认是安装到/usr/local下的)
3) 使用sudo scons install命令进行安装 ,安装后使用pkg-config sunpinyin-2.0 --modversion查看是否出现2.0.3,出现表示安装成功
step4:安装ibus界面
1) 使用sudo tar -zxvf ibus-sunpinyin-2.0.3.tar.gz 解压ibus-sunpinyin-2.0.3.tar.gz。进入该目录
2) 使用scons --prefix=/usr 进行编译(--prefix=/usr表示将文件安装到/usr,默认是安装到/usr/local下的)
3) 使用sudo scons install命令进行安装 。安装后重启ibus就可以使用sunpinyin输入法了
以下是安装过程中可能出现的问题:
1)
- <strong>scons: Reading SConscript files ...
- ImportError: No module named textfile:
- File "/home/lgmtest/下载/ibus-sunpinyin-2.0.3/SConstruct", line 2:
- import SCons.Tool.textfile</strong>
出现原因:scons版本太低,使用scons --version查看版本,发现是1.2的。
解决方案:去http://www.scons.org/下载最新版scons,下载后解压缩,进入目录,使用python setup.py install进行安装。
2)
- scons: Reading SConscript files ...
- Checking for pkg-config... yes
- Checking for ibus-1.0... no
出现原因:没有安装libibus-dev,使用sudo apt-get install libibus-dev 安装ibus。
最后附带安装成功输入法截图:
另,推荐Google拼音输入法。
参考:
Ubuntu 10.04下安装Google拼音输入法 http://www.linuxidc.com/Linux/2010-06/26440.htm
Ubuntu 10.10 安装谷歌PinYin拼音输入法详细过程 http://www.linuxidc.com/Linux/2011-03/33838.htm
216:12: warning: ‘GtkWidget* gtk_hbox_new(gboolean, gint)’ is deprecated (declared at /usr/include/gtk-3.0/gtk/deprecated/gtkhbox.h:62): Use 'gtk_box_new' instead [-Wdeprecated-declarations]
imi_gtkwin.cpp:216:33: warning: ‘GtkWidget* gtk_hbox_new(gboolean, gint)’ is deprecated (declared at /usr/include/gtk-3.0/gtk/deprecated/gtkhbox.h:62): Use 'gtk_box_new' instead [-Wdeprecated-declarations]
scons: *** [imi_gtkwin.o] Error 1
scons: building terminated because of errors.
imi_gtkwin.h:49:29: fatal error: imi_glibHandler.h: No such file or directory
compilation terminated.
scons: *** [imi_gtkwin.o] Error 1
scons: building terminated because of errors.
kipo@kipo-K42JZ ~/sunpinyin/wrapper/gtk_standalone $ scons
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
g++ -o imi_gtkwin.o -c -g -DDEBUG -pthread -I/usr/include/gtk-3.0 -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/glib-2.0 -I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/pixman-1 -I/usr/include/libpng12 -I/usr/include/sunpinyin-2.0 -I/usr/include/sunpinyin-2.0/ime-core -I/usr/include/sunpinyin-2.0/lexicon -I/usr/include/sunpinyin-2.0/slm -I/usr/include/sunpinyin-2.0/slm/tslmendian -I/usr/include/sunpinyin-2.0/slm/slmprune -I/usr/include/sunpinyin-2.0/slm/tslminfo -I/usr/include/sunpinyin-2.0/slm/getWordFreq -I/usr/include/sunpinyin-2.0/slm/slmbuild -I/usr/include/sunpinyin-2.0/slm/ids2ngram -I/usr/include/sunpinyin-2.0/slm/thread -I/usr/include/sunpinyin-2.0/slm/slminfo -I/usr/include/sunpinyin-2.0/slm/tools -I/usr/include/sunpinyin-2.0/slm/tslmpack -I/usr/include/sunpinyin-2.0/slm/mmseg -I/usr/include/sunpinyin-2.0/slm/slmseg -I/usr/include/sunpinyin-2.0/pinyin imi_gtkwin.cpp
In file included from imi_gtkwin.h:49:0,
from imi_gtkwin.cpp:42:
imi_glibHandler.h: In function ‘gboolean UpdateCallback(gpointer)’:
imi_glibHandler.h:50:28: error: ‘class CIMIWinHandler’ has no member named ‘doneDeferedUpdate’
imi_glibHandler.h:51:25: error: no matching function for call to ‘CIMIView::updateWindows()’
imi_glibHandler.h:51:25: note: candidate is:
In file included from imi_glibHandler.h:44:0,
from imi_gtkwin.h:49,
from imi_gtkwin.cpp:42:
/usr/include/sunpinyin-2.0/ime-core/imi_view.h:204:18: note: virtual void CIMIView::updateWindows(unsigned int)
/usr/include/sunpinyin-2.0/ime-core/imi_view.h:204:18: note: candidate expects 1 argument, 0 provided
imi_gtkwin.cpp: In member function ‘bool CGTKWinHandler::createWindows()’:
imi_gtkwin.cpp:194:11: warning: ‘GtkWidget* gtk_vbox_new(gboolean, gint)’ is deprecated (declared at /usr/include/gtk-3.0/gtk/deprecated/gtkvbox.h:60): Use 'gtk_box_new' instead [-Wdeprecated-declarations]
imi_gtkwin.cpp:194:32: warning: ‘GtkWidget* gtk_vbox_new(gboolean, gint)’ is deprecated (declared at /usr/include/gtk-3.0/gtk/deprecated/gtkvbox.h:60): Use 'gtk_box_new' instead [-Wdeprecated-declarations]
imi_gtkwin.cpp:216:12: warning: ‘GtkWidget* gtk_hbox_new(gboolean, gint)’ is deprecated (declared at /usr/include/gtk-3.0/gtk/deprecated/gtkhbox.h:62): Use 'gtk_box_new' instead [-Wdeprecated-declarations]
imi_gtkwin.cpp:216:33: warning: ‘GtkWidget* gtk_hbox_new(gboolean, gint)’ is deprecated (declared at /usr/include/gtk-3.0/gtk/deprecated/gtkhbox.h:62): Use 'gtk_box_new' instead [-Wdeprecated-declarations]
scons: *** [imi_gtkwin.o] Error 1
scons: building terminated because of errors.
kipo@kipo-K42JZ ~/sunpinyin/wrapper/gtk_standalone $