解决Ubuntu中QtCreator(3.6.1)不能使用搜狗输入法录入汉字问题

原文地址:http://my.oschina.net/lieefu/blog/505363?fromerr=zDmM5RzP

安装环境及版本

System:Ubuntu16.04LTS
Languge:Chinese
InputMethod:搜狗输入法
Qt Version: Qt 5.6.0
Qt Creator:3.6.1

解决步骤

在Qt5.3之前,我发布过解决办法 解决Qt5 Creator无法切换输入法(fcitx),不能录入汉字问题,Qt5.4以及Qt5.5,旧办法失效,原因是Qt5.4后对之前Qt5版本不再二进制兼容,libfcitxplatforminputcontextplugin.so 需要编译最新的fcitx-qt5。如果你懒得自己编译,可以下载我编译的 libfcitxplatforminputcontextplugin.so

看fcitx-qt5项目的更新日志,是在1.0.3版本时解决的这个问题,写本篇博客时,我git clone到的是1.0.4版本。

  • 编译fcitx-qt需要cmake,安装cmake命令,如果已经安装,请略过。
    sudo apt-get install cmake
  • 安装 fcitx-libs-dev
    sudo apt-get install fcitx-libs-dev
  • 设置qmake的环境变量:
    export PATH="/home/jeffrey/Qt5.6.0/5.6/gcc_64/bin":$PATH
  • 下载fcitx-libs源码:
    git clone git@github.com:fcitx/fcitx-qt5.git
  • 编译方法:
    cd fcitx-qt5
    cd fcitx-qt5
    cmake .
    make
    sudo make install

  • 最后把编译得到 libfcitxplatforminputcontextplugin.so 拷贝到 Qt5.5安装目录的 Tools/QtCreator/bin/plugins/platforminputcontexts

  • Qt5.6的目录是 Tools/QtCreator/lib/Qt/plugins/platforminputcontexts

错误处理

  1. 
    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!
  2. CMake Error at /home/lieefu/Qt5.5.0/5.5/gcc_64/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.c
    make:9 (message):
    Failed to find "GL/gl.h" in "/usr/include/libdrm".

    • 解决方法:
      sudo apt-get install libgl1-mesa-dev libglu1-mesa-dev
  3. -- Found PkgConfig: /usr/bin/pkg-config (found version "0.26")
    -- Could NOT find XKBCommon_XKBCommon (missing:
    XKBCommon_XKBCommon_LIBRARY
    XKBCommon_XKBCommon_INCLUDE_DIR)
    CMake Error at /usr/share/cmake2.8/Modules/FindPackageHandleStandardArgs.cmake:108 (message):
    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
  4. YACC src/xkbcomp/parser.c
    ./build-aux/ylwrap: line 176: yacc: command not found
    make: *** [src/xkbcomp/parser.c] Error 127

    • 解决方法:sudo apt-get install bison
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值