Linux下离线编译安装fictx-qt
备注:解决Linux下Qt无法使用fcitx输入法问题
1.下载fictx-qt源码
-
https://github.com/fcitx/fcitx-qt5/tree/1.2.7
我这里选择1.2.7版本
2.解压fictx-qt源码
#解压命令就不写了
3.编译安装
#创建构建目录
mkdir build && cd build
#cmake命令,注意qt目录换为自己环境中的目录
cmake .. -DENABLE_LIBRARY=false -DQt5_DIR=/opt/Qt5.14.2/lib/cmake/Qt5
#安装
make && make install
**注意:**make install会将生成的libfcitxplatforminputcontextplugin.so拷贝到/opt/Qt5.14.2/5.14.2/gcc_64/plugins/platforminputcontexts/下
错误1:
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/shana/fcitx-qt5/build/CMakeFiles/CMakeOutput.log".
解决方案:
-
安装extra-cmake-modules
-
#有网络情况下:
sudo apt install extra-cmake-modules
-
#无网络情况下:
#编译安装extra-cmake-modules,获取其它办法也可。 #编译安装方法如下: #下载源码:https://gitee.com/lihejia/extra-cmake-modules/repository/archive/v5.47.0.zip mkdir build && cd build cmake .. make && make install
-
错误2:
Could NOT find XKBCommon XKBCommon
(missing: XKBCommon XKBCommon LIBRARY XKBCommon XKBCommon INCLUDE OIR (found version "")CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (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.16/Modules/FindPackageHandlestandardArgs.cmake:393 ( FPHSA FAILURE MESSAGE)l cmake/FindXKBCommon.cmake:30 (find_package_handle_standard_args) CMakeLists.txt:50 (find_package)
解决方案:
-
安装libxkbcommon-dev
sudo apt-get install libxkbcommon-dev