网上很多方法都是把系统库下的libfcitxplatforminputcontextplugin.so复制到qt的目录下,但我的没效果。
我的QT版本为Qt5.14.1
下面是编译安装的方法。
正确的安装步骤
下载源码fcitx-qt5的源码git clone /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" (requestedversion 1.4.0) with any of the following names:ECMConfig.cmakeecm-config.cmakeAdd 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 aseparate 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 - SuccessCMake Error at CMakeLists.txt:31 (find_package):Could not find a package configuration file provided by "Qt5" (requestedversion 5.1.0) with any of the following names:Qt5Config.cmakeqt5-config.cmakeAdd 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 aseparate 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) (Requiredis 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