Qt5.5.1 (Qt5.x) Creator 无法输入中文(fcitx,搜狗输入法)
参考:http://www.linuxdiyf.com/linux/17005.htmlhttp://zisxks.com/2013/11/29/compile-fcitx-qt5-in-Ubuntu-12.04/----------------访问 https://github.com/fcitx/fcitx-qt5 并下载源码;编译复制文
- 访问 https://github.com/fcitx/fcitx-qt5 并下载源码;
- 编译
- 复制文件到QT相关安装目录 (或者直接解压附件文件logico-output-plugin.zip, 拷贝我编译好的文件)
详细步骤:(系统安装的 QT5.5.1, 安装目录为 /data/sw/Qt5.5.1/ )
1. git clone https://github.com/fcitx/fcitx-qt5.git
2. cd fcitx-qt5
2. 修改根目录文件 CMakeLists.txt, 在"set(CMAKE_MODULE_PATH ..."行之后加入:
set(Qt5Core_DIR /data/sw/Qt5.5.1/5.5/gcc_64/lib/cmake/Qt5Core/)
set(Qt5Gui_DIR /data/sw/Qt5.5.1/5.5/gcc_64/lib/cmake/Qt5Gui/)
set(Qt5Widgets_DIR /data/sw/Qt5.5.1/5.5/gcc_64/lib/cmake/Qt5Widgets/)
set(Qt5DBus_DIR /data/sw/Qt5.5.1/5.5/gcc_64/lib/cmake/Qt5DBus/)
3. 编译:
cmake .
make
sudo make install
4. 最后把编译得到 libfcitxplatforminputcontextplugin.so 拷贝到 Qt5.5安装目录的
/data/sw/Qt5.5.1/5.5/gcc_64/plugins/platforminputcontexts/
/data/sw/Qt5.5.1/Tools/QtCreator/bin/plugins/platforminputcontexts/
(拷贝之后记得加 755 权限)
5. 若上面步骤不行, 则在 ~/.profile 文件末尾添加:
GTK_IM_MODULE=fcitx
export XIM_PROGRAM=fcitx
export XIM=fcitx
export QT_IM_MODULE=fcitx
export GTK_IM_MODULE=fcitx
export XMODIFIERS="@im=fcitx"
异常:
- 找不到 "ECM" 配置
----------------------------------------------------------------------------
Could not find a package configuration file provided by "ECM" (requested
version 1.4.0) with any of the following names:
ECMConfig.cmake
ecm-config.cmake
Add the installation prefix of "ECM" to CMAKE_PREFIX_PATH or set "ECM_DIR"
to a directory containing one of the above files. If "ECM" provides a
separate development package or SDK, be sure it has been installed.
-- Configuring incomplete, errors occurred!
-------------------------------------------------------------------------------
[解决方法]
1. 访问: https://launchpad.net/ubuntu/+source/extra-cmake-modules/1.4.0-0ubuntu1
2. 下载: extra-cmake-modules_1.4.0.orig.tar.xz
3. 解压后编译安装:
cd extra-cmake-modules-1.4.0
cmake .
make
sudo make install
-
CMake Error at /home/lieefu/Qt5.5.0/5.5/gcc_64/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake:9 (message):
Failed to find "GL/gl.h" in "/usr/include/libdrm".
[解决方法]
sudo apt-get install libgl1-mesa-dev libglu1-mesa-dev
- Could NOT find XKBCommon (missing: XKBCommon_LIBRARIES XKBCommon) (Required
is at least version "0.5.0")
[解决方法]
wget http://xkbcommon.org/download/libxkbcommon-0.5.0.tar.xz
tar xf libxkbcommon-0.5.0.tar.xz
./configure -prefix=/usr -libdir=/usr/lib/x86_64-linux-gnu -disable-x11
make
sudo make install
- 编译libxkbcommon时无法使用 doxygen , (运行出现段错误)
[解决方法]
不使用 doxygen 生成 文档:
修改 configure, 在下面代码之后加入 "use_doxygen=no":
# Check whether --with-doxygen was given.
if test "${with_doxygen+set}" = set; then :
withval=$with_doxygen; use_doxygen=$withval
else
use_doxygen=auto
fi
use_doxygen=no
- 已经安装libxkbcommon.so, 但还是报错(版本低)
Could NOT find XKBCommon: Found unsuitable version "0.4.1", but required is
at least "0.5.0" (found /usr/lib/x86_64-linux-gnu/libxkbcommon.so)
[解决方法]
修改CMakeCache.txt 文件:(强行修改当前检测到的版本到 0.5.0)
PKG_XKBCommon_XKBCommon_VERSION:INTERNAL=0.5.0
更多推荐
所有评论(0)