deepin linux下解决Qt搜狗输入法无法输入中文

编程知识 更新时间:2023-05-03 01:07:39

网上很多方法都是把系统库下的libfcitxplatforminputcontextplugin.so复制到qt的目录下,但我的没效果。
我的QT版本为Qt5.14.1
下面是编译安装的方法。

正确的安装步骤

  • 下载源码fcitx-qt5的源码
    git clone https://github/fcitx/fcitx-qt5
  • 安装依赖
    sudo apt install cmake fcitx-libs-dev extra-cmake-modules libxkbcommon-dev
  • 将qt的工具链加入PATH变量(这一步的目录大家可能不一样)
    export PATH=$PATH:/home/leon/Qt5.14.1/5.14.1/gcc_64/bin
  • 开始编译
    cd fcitx-qt5
    cmake .
    make
    sudo make install
  • 复制
    cp /home/leon/Qt5.14.1/5.14.1/gcc_64/plugins/platforminputcontexts/libfcitxplatforminputcontextplugin.so /home/leon/Qt5.14.1/Tools/QtCreator/lib/Qt/plugins/platforminputcontexts/libfcitxplatforminputcontextplugin.so

遇到错误解决(下面是踩坑步骤)

cmake错误1 – ECMConfig.cmake

CMake Error at CMakeLists.txt:8 (find_package):
  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!
See also "/home/leon/Downloads/sougou_qt/fcitx-qt5/build/CMakeFiles/CMakeOutput.log".

解决办法,装软件
sudo apt install extra-cmake-modules

错误2 – Qt5Config.cmake

-- Performing Test SUPPORT_CXX11
-- Performing Test SUPPORT_CXX11 - Success
CMake Error at CMakeLists.txt:31 (find_package):
  Could not find a package configuration file provided by "Qt5" (requested
  version 5.1.0) with any of the following names:

    Qt5Config.cmake
    qt5-config.cmake

  Add the installation prefix of "Qt5" to CMAKE_PREFIX_PATH or set "Qt5_DIR"
  to a directory containing one of the above files.  If "Qt5" provides a
  separate development package or SDK, be sure it has been installed.


-- Configuring incomplete, errors occurred!
See also "/home/leon/Downloads/sougou_qt/fcitx-qt5/build/CMakeFiles/CMakeOutput.log".

解决办法:没有配置qt工具的环境变量
export PATH=$PATH:/home/leon/Qt5.14.1/5.14.1/gcc_64/bin

错误3–XKBCommon

-- Could NOT find XKBCommon_XKBCommon (missing: XKBCommon_XKBCommon_LIBRARY XKBCommon_XKBCommon_INCLUDE_DIR) 
CMake Error at /usr/share/cmake-3.9/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find XKBCommon (missing: XKBCommon_LIBRARIES XKBCommon) (Required
  is at least version "0.5.0")
Call Stack (most recent call first):
  /usr/share/cmake-3.9/Modules/FindPackageHandleStandardArgs.cmake:377 (_FPHSA_FAILURE_MESSAGE)
  cmake/FindXKBCommon.cmake:30 (find_package_handle_standard_args)
  CMakeLists.txt:33 (find_package)

解决办法,装库
sudo apt-get install libxkbcommon-dev

更多推荐

deepin linux下解决Qt搜狗输入法无法输入中文

本文发布于:2023-04-29 19:29:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/aed89f41dee94691e8914d62f0bac21a.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:搜狗   输入法   输入中文   deepin   linux

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!

  • 111908文章数
  • 28510阅读数
  • 0评论数