MMA 13.3 无法输入中文

您所在的位置:网站首页 安装zst MMA 13.3 无法输入中文

MMA 13.3 无法输入中文

2023-07-19 17:09| 来源: 网络整理| 查看: 265

系统是 Ubuntu 22.04,输入法用的是搜狗,其实就是 fcitx,系统中装的是基于 qt5 的,而 MMA 13.3 的界面是基于 qt6.4.2 的(13.1 还是 qt5 呢),这个版本可以通过直接运行 libQt6Core.so 得到。

$ .../13.3/SystemFiles/Components/WSMCore/SystemModeler/SystemFiles/Libraries/Linux-x86-64/libQt6Core.so.6 This is the QtCore library version Qt 6.4.2 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 10.2.1 20210130 (Red Hat 10.2.1-11)) Copyright (C) 2016 The Qt Company Ltd. Contact: http://www.qt.io/licensing/ ...

关于 fctix 的 Qt6 支持,主要参考的如下文章 https://zhuanlan.zhihu.com/p/597695401

1. 下载清华提供的在线安装器

https://mirrors.tuna.tsinghua.edu.cn/qt/official_releases/online_installers/qt-unified-linux-x64-online.run

2. 配置镜像地址运行安装器 清华源 ./qt-unified-linux-x64-online.run --mirror https://mirrors.tuna.tsinghua.edu.cn/qt 南大源 ./qt-unified-linux-x64-online.run --mirror http://mirrors.nju.edu.cn/qt/

安装时需要登录 qt 账号,没有的话则先注册一个。由于开始我看错了,看成 6.2.4 版本了,所以我装的是 6.2.4 而不是 6.4.2,不过不影响最后使用。

3. 编译 fcitx5 的 qt6 插件

首先安装相关依赖

sudo apt install libgl-dev extra-cmake-modules libxkbcommon-dev qtbase5-private-dev

下载 fcitx-qt5 修改配置并编译

git clone https://kgithub.com/fcitx/fcitx-qt5 cd fcitx-qt5 #这里qt版本看你自己安装的是什么版本 export PATH=~/Qt/6.2.4/gcc_64/bin/:~/Qt/Tools/CMake/bin/:$PATH vi CMakeLists.txt #修改以下两行 option(ENABLE_QT5 "Enable Qt5" Off) option(ENABLE_QT6 "Enable Qt6 im module" On) mkdir build && cd build cmake ../ #cpu是几线程,j后面就写几 make -j16

然而 cmake ../ 时却有如下错误提示

CMake Error at CMakeLists.txt:46 (find_package): By not providing "FindFcitx.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Fcitx", but CMake did not find one. Could not find a package configuration file provided by "Fcitx" (requested version 4.2.8) with any of the following names: FcitxConfig.cmake fcitx-config.cmake Add the installation prefix of "Fcitx" to CMAKE_PREFIX_PATH or set "Fcitx_DIR" to a directory containing one of the above files. If "Fcitx" provides a separate development package or SDK, be sure it has been installed.

网上搜索,发现需加一个参数才行,运行 cmake -DENABLE_LIBRARY=false ../ 就可以了。make 后很快就编译完成,然后把 qt6/platforminputcontext/libfcitxplatforminputcontextplugin-qt6.so 复制到 .../13.3/SystemFiles/Libraries/Linux-x86-64/Qt/plugins/platforminputcontexts/ 目录下即可。

注:最初尝试提取 arch linux 的 fcitx-qt6-1.2.7-14-x86_64.pkg.tar.zst 包中的 libfcitxplatforminputcontextplugin-qt6.so 文件复制过去,发现不管用,不知道是不是版本的问题还是依赖的问题。



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3