kylinV10上qt5.9不能输入中文解决方法(二)

38 篇文章 3 订阅

文章目录

源码安装fcitx-qt5

  1. git路径
git clone https://github.com/fcitx/fcitx-qt5.git
  1. 编译步骤
mkdir bulid
cd bulid
cmake ..
make -j12
cd platforminputcontext/
cp libfcitxplatforminputcontextplugin.so /home/yx/Qt5.11.3/5.11.3/gcc_64/plugins/platforminputcontexts
cp libfcitxplatforminputcontextplugin.so /home/yx/Qt5.11.3/Tools/QtCreator/lib/Qt/plugins/platforminputcontexts/
  1. 安装缺少的软件
  • 报错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.

解决

tlx@TLX001:fcitx-qt5$ sudo apt-get install extra-cmake-modules -y
正在读取软件包列表... 完成
正在分析软件包的依赖关系树       
正在读取状态信息... 完成       
下列软件包是自动安装的并且现在不需要了:
  aptdaemon aptdaemon-data python-pwquality python3-aptdaemon python3-aptdaemon.gtk3widgets
  python3-defer
使用'sudo apt autoremove'来卸载它(它们)。
下列【新】软件包将被安装:
  extra-cmake-modules
升级了 0 个软件包,新安装了 1 个软件包,要卸载 0 个软件包,有 22 个软件包未被升级。
需要下载 144 kB 的归档。
解压缩后会消耗 954 kB 的额外空间。
获取:1 http://archive.kylinos.cn/kylin/KYLIN-ALL 10.0/main amd64 extra-cmake-modules amd64 5.18.0-0kord1 [144 kB]
已下载 144 kB,耗时 0秒 (227 kB/s)          
正在选中未选择的软件包 extra-cmake-modules。
(正在读取数据库 ... 系统当前共安装有 232497 个文件和目录。)
正准备解包 .../extra-cmake-modules_5.18.0-0kord1_amd64.deb  ...
正在解包 extra-cmake-modules (5.18.0-0kord1) ...
正在处理用于 man-db (2.7.5-1kord) 的触发器 ...
正在设置 extra-cmake-modules (5.18.0-0kord1) ...
  • 报错2
-- Could NOT find XKBCommon_XKBCommon (missing:  XKBCommon_XKBCommon_LIBRARY XKBCommon_XKBCommon_INCLUDE_DIR) 
CMake Error at /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:148 (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.5/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
  cmake/FindXKBCommon.cmake:30 (find_package_handle_standard_args)
  CMakeLists.txt:33 (find_package)

解决

tlx@TLX001:build$ sudo apt-get install -y libxkbcommon-dev
正在读取软件包列表... 完成
正在分析软件包的依赖关系树       
正在读取状态信息... 完成       
下列软件包是自动安装的并且现在不需要了:
  aptdaemon aptdaemon-data python-pwquality python3-aptdaemon python3-aptdaemon.gtk3widgets
  python3-defer
使用'sudo apt autoremove'来卸载它(它们)。
下列【新】软件包将被安装:
  libxkbcommon-dev
升级了 0 个软件包,新安装了 1 个软件包,要卸载 0 个软件包,有 22 个软件包未被升级。
需要下载 237 kB 的归档。
解压缩后会消耗 1,445 kB 的额外空间。
获取:1 http://archive.kylinos.cn/kylin/KYLIN-ALL 10.0/main amd64 libxkbcommon-dev amd64 0.5.0-1kord2.1 [237 kB]
已下载 237 kB,耗时 0秒 (773 kB/s)       
正在选中未选择的软件包 libxkbcommon-dev。
(正在读取数据库 ... 系统当前共安装有 232684 个文件和目录。)
正准备解包 .../libxkbcommon-dev_0.5.0-1kord2.1_amd64.deb  ...
正在解包 libxkbcommon-dev (0.5.0-1kord2.1) ...
正在设置 libxkbcommon-dev (0.5.0-1kord2.1) ...
  • 报错3
-- Found XKBCommon: /usr/lib/x86_64-linux-gnu/libxkbcommon.so (found suitable version "0.5.0", minimum required is "0.5.0") found components:  XKBCommon 
CMake Error at CMakeLists.txt:36 (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.

解决:libxkbcommon的版本不对,需要安装对应的版本步骤如下

tlx@TLX001:~$ wget http://xkbcommon.org/download/libxkbcommon-0.5.0.tar.xz
--2021-03-11 17:35:46--  http://xkbcommon.org/download/libxkbcommon-0.5.0.tar.xz
正在解析主机 xkbcommon.org (xkbcommon.org)... 176.58.101.62, 2a01:7e00::f03c:91ff:fe59:dbe4
正在连接 xkbcommon.org (xkbcommon.org)|176.58.101.62|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 301 Moved Permanently
位置:https://xkbcommon.org/download/libxkbcommon-0.5.0.tar.xz [跟随至新的 URL]
--2021-03-11 17:35:56--  https://xkbcommon.org/download/libxkbcommon-0.5.0.tar.xz
正在连接 xkbcommon.org (xkbcommon.org)|176.58.101.62|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:615504 (601K) [application/octet-stream]
正在保存至: “libxkbcommon-0.5.0.tar.xz”

libxkbcommon-0.5.0.tar.xz 100%[==================================>] 601.08K  3.73KB/s    in 1m 55s  

2021-03-11 17:37:52 (5.25 KB/s) - 已保存 “libxkbcommon-0.5.0.tar.xz” [615504/615504])

tlx@TLX001:~$ ls
cosmo              ftp             libinterface.so            qtsrc   视频  下载
dsafeshare_mac_UI  go              libxkbcommon-0.5.0.tar.xz  公共的  图片  音乐
fcitx-qt5          libinterface.h  Log                        模板    文档  桌面
tlx@TLX001:~$ tar -xJf libxkbcommon-0.5.0.tar.xz 
tlx@TLX001:~$ ls
cosmo              ftp             libinterface.so            Log     模板  文档  桌面
dsafeshare_mac_UI  go              libxkbcommon-0.5.0         qtsrc   视频  下载
fcitx-qt5          libinterface.h  libxkbcommon-0.5.0.tar.xz  公共的  图片  音乐
tlx@TLX001:~$ cd libxkbcommon-0.5.0/
tlx@TLX001:libxkbcommon-0.5.0$ ls
aclocal.m4    COPYING      makekeys.py  test                         xkbcommon-x11.map
bench         doc          NEWS         xkbcommon                    xkbcommon-x11.pc.in
build-aux     m4           PACKAGING    xkbcommon.map                xkbcommon-x11-uninstalled.pc.in
configure     Makefile.am  README.md    xkbcommon.pc.in
configure.ac  Makefile.in  src          xkbcommon-uninstalled.pc.in
tlx@TLX001:libxkbcommon-0.5.0$ sudo apt-get install -y bison
正在读取软件包列表... 完成
正在分析软件包的依赖关系树       
正在读取状态信息... 完成       
下列软件包是自动安装的并且现在不需要了:
  aptdaemon aptdaemon-data python-pwquality python3-aptdaemon python3-aptdaemon.gtk3widgets
  python3-defer
使用'sudo apt autoremove'来卸载它(它们)。
将会同时安装下列软件:
  libbison-dev
建议安装:
  bison-doc
下列【新】软件包将被安装:
  bison libbison-dev
升级了 0 个软件包,新安装了 2 个软件包,要卸载 0 个软件包,有 22 个软件包未被升级。
需要下载 598 kB 的归档。
解压缩后会消耗 1,795 kB 的额外空间。
获取:1 http://archive.kylinos.cn/kylin/KYLIN-ALL 10.0/main amd64 libbison-dev amd64 2:3.0.4.dfsg-1kord [339 kB]
获取:2 http://archive.kylinos.cn/kylin/KYLIN-ALL 10.0/main amd64 bison amd64 2:3.0.4.dfsg-1kord [259 kB]
已下载 598 kB,耗时 0秒 (663 kB/s)
正在选中未选择的软件包 libbison-dev:amd64。
(正在读取数据库 ... 系统当前共安装有 232758 个文件和目录。)
正准备解包 .../libbison-dev_2%3a3.0.4.dfsg-1kord_amd64.deb  ...
正在解包 libbison-dev:amd64 (2:3.0.4.dfsg-1kord) ...
正在选中未选择的软件包 bison。
正准备解包 .../bison_2%3a3.0.4.dfsg-1kord_amd64.deb  ...
正在解包 bison (2:3.0.4.dfsg-1kord) ...
正在处理用于 man-db (2.7.5-1kord) 的触发器 ...
正在设置 libbison-dev:amd64 (2:3.0.4.dfsg-1kord) ...
正在设置 bison (2:3.0.4.dfsg-1kord) ...
update-alternatives: 使用 /usr/bin/bison.yacc 来在自动模式中提供 /usr/bin/yacc (yacc)
tlx@TLX001:libxkbcommon-0.5.0$ ls
aclocal.m4    COPYING      makekeys.py  test                         xkbcommon-x11.map
bench         doc          NEWS         xkbcommon                    xkbcommon-x11.pc.in
build-aux     m4           PACKAGING    xkbcommon.map                xkbcommon-x11-uninstalled.pc.in
configure     Makefile.am  README.md    xkbcommon.pc.in
configure.ac  Makefile.in  src          xkbcommon-uninstalled.pc.in
tlx@TLX001:libxkbcommon-0.5.0$ ./configure --disable-x11
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for mt... mt
checking if mt is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for gcc option to accept ISO C99... none needed
checking whether __clang__ is declared... no
checking whether __INTEL_COMPILER is declared... no
checking whether __SUNPRO_C is declared... no
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking if gcc supports -Werror=unknown-warning-option... no
checking if gcc supports -Werror=unused-command-line-argument... no
checking if gcc supports -Wall... yes
checking if gcc supports -Wpointer-arith... yes
checking if gcc supports -Wmissing-declarations... yes
checking if gcc supports -Wformat=2... yes
checking if gcc supports -Wstrict-prototypes... yes
checking if gcc supports -Wmissing-prototypes... yes
checking if gcc supports -Wnested-externs... yes
checking if gcc supports -Wbad-function-cast... yes
checking if gcc supports -Wold-style-definition... yes
checking if gcc supports -Wdeclaration-after-statement... yes
checking if gcc supports -Wunused... yes
checking if gcc supports -Wuninitialized... yes
checking if gcc supports -Wshadow... yes
checking if gcc supports -Wmissing-noreturn... yes
checking if gcc supports -Wmissing-format-attribute... yes
checking if gcc supports -Wredundant-decls... yes
checking if gcc supports -Wlogical-op... yes
checking if gcc supports -Werror=implicit... yes
checking if gcc supports -Werror=nonnull... yes
checking if gcc supports -Werror=init-self... yes
checking if gcc supports -Werror=main... yes
checking if gcc supports -Werror=missing-braces... yes
checking if gcc supports -Werror=sequence-point... yes
checking if gcc supports -Werror=return-type... yes
checking if gcc supports -Werror=trigraphs... yes
checking if gcc supports -Werror=array-bounds... yes
checking if gcc supports -Werror=write-strings... yes
checking if gcc supports -Werror=address... yes
checking if gcc supports -Werror=int-to-pointer-cast... yes
checking if gcc supports -Werror=pointer-to-int-cast... yes
checking if gcc supports -pedantic... yes
checking if gcc supports -Werror... yes
checking if gcc supports -Werror=attributes... yes
Package xorg-macros was not found in the pkg-config search path.
Perhaps you should add the directory containing `xorg-macros.pc'
to the PKG_CONFIG_PATH environment variable
Package 'xorg-macros', required by 'world', not found
checking whether make supports nested variables... (cached) yes
checking whether to build documentation... yes
checking for doxygen... no
configure: WARNING: doxygen not found - documentation targets will be skipped
checking for inline... inline
checking for pkg-config... (cached) /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for bison... bison -y
checking for bison... /usr/bin/bison
checking for strcasecmp... yes
checking for strncasecmp... yes
checking for eaccess... yes
checking for euidaccess... yes
checking for mmap... yes
checking for secure_getenv... yes
checking for __secure_getenv... no
checking for __builtin_expect... yes
checking linux/input.h usability... yes
checking linux/input.h presence... yes
checking for linux/input.h... yes
checking if gcc supports -fvisibility=hidden... yes
checking if gcc supports -Wextra -Wno-unused-parameter -Wno-missing-field-initializers... yes
checking if gcc supports -Wdocumentation... no
checking whether the linker accepts -Wl,--no-undefined... yes
checking for clock_gettime in -lrt... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating xkbcommon-uninstalled.pc
config.status: creating xkbcommon.pc
config.status: creating xkbcommon-x11.pc
config.status: creating xkbcommon-x11-uninstalled.pc
config.status: creating doc/Doxyfile
config.status: creating src/config.h
config.status: executing depfiles commands
config.status: executing libtool commands

        libxkbcommon 0.5.0

        libxkbcommon:            yes
        libxkbcommon-x11:        no
        documentation:           yes

        default XKB rules:       evdev
        default XKB model:       pc105
        default XKB layout:      us
        default XKB variant:     
        default XKB options:     

        prefix:                  /usr/local
        includedir:              ${prefix}/include
        lib dir:                 ${exec_prefix}/lib
        XKB config root:         /usr/share/X11/xkb
        X11 locale root:         ${datarootdir}/X11/locale

tlx@TLX001:libxkbcommon-0.5.0$ make -j8
  YACC     src/xkbcomp/parser.c
updating src/xkbcomp/parser.h
make  all-am
make[1]: Entering directory '/home/tlx/libxkbcommon-0.5.0'
  CC       src/compose/table.lo
  CC       src/compose/parser.lo
  CC       src/compose/state.lo
  CC       src/xkbcomp/action.lo
  CC       src/compose/paths.lo
  CC       src/xkbcomp/expr.lo
  CC       src/xkbcomp/compat.lo
  CC       src/xkbcomp/ast-build.lo
  CC       src/xkbcomp/include.lo
  CC       src/xkbcomp/keycodes.lo
  CC       src/xkbcomp/keymap.lo
  CC       src/xkbcomp/keymap-dump.lo
  CC       src/xkbcomp/keywords.lo
  CC       src/xkbcomp/parser.lo
  CC       src/xkbcomp/rules.lo
  CC       src/xkbcomp/scanner.lo
  CC       src/xkbcomp/symbols.lo
  CC       src/xkbcomp/types.lo
  CC       src/xkbcomp/vmod.lo
  CC       src/xkbcomp/xkbcomp.lo
  CC       src/atom.lo
  CC       src/context.lo
  CC       src/context-priv.lo
  CC       src/keysym.lo
  CC       src/keysym-utf.lo
  CC       src/keymap.lo
  CC       src/keymap-priv.lo
  CC       src/state.lo
  CC       src/text.lo
  CC       src/utf8.lo
  CC       src/utils.lo
  CCLD     libxkbcommon.la
copying selected object files to avoid basename conflicts...
ar: `u' modifier ignored since `D' is the default (see `U')
make[1]: Leaving directory '/home/tlx/libxkbcommon-0.5.0'
tlx@TLX001:libxkbcommon-0.5.0$ make install 
make  install-am
make[1]: Entering directory '/home/tlx/libxkbcommon-0.5.0'
make[2]: Entering directory '/home/tlx/libxkbcommon-0.5.0'
 /bin/mkdir -p '/usr/local/lib'
 /bin/bash ./libtool   --mode=install /usr/bin/install -c   libxkbcommon.la '/usr/local/lib'
libtool: install: /usr/bin/install -c .libs/libxkbcommon.so.0.0.0 /usr/local/lib/libxkbcommon.so.0.0.0
/usr/bin/install: cannot create regular file '/usr/local/lib/libxkbcommon.so.0.0.0': Permission denied
Makefile:1030: recipe for target 'install-libLTLIBRARIES' failed
make[2]: *** [install-libLTLIBRARIES] Error 1
make[2]: Leaving directory '/home/tlx/libxkbcommon-0.5.0'
Makefile:2109: recipe for target 'install-am' failed
make[1]: *** [install-am] Error 2
make[1]: Leaving directory '/home/tlx/libxkbcommon-0.5.0'
Makefile:2103: recipe for target 'install' failed
make: *** [install] Error 2
tlx@TLX001:libxkbcommon-0.5.0$ sudo make install 
make  install-am
make[1]: Entering directory '/home/tlx/libxkbcommon-0.5.0'
make[2]: Entering directory '/home/tlx/libxkbcommon-0.5.0'
 /bin/mkdir -p '/usr/local/lib'
 /bin/bash ./libtool   --mode=install /usr/bin/install -c   libxkbcommon.la '/usr/local/lib'
libtool: install: /usr/bin/install -c .libs/libxkbcommon.so.0.0.0 /usr/local/lib/libxkbcommon.so.0.0.0
libtool: install: (cd /usr/local/lib && { ln -s -f libxkbcommon.so.0.0.0 libxkbcommon.so.0 || { rm -f libxkbcommon.so.0 && ln -s libxkbcommon.so.0.0.0 libxkbcommon.so.0; }; })
libtool: install: (cd /usr/local/lib && { ln -s -f libxkbcommon.so.0.0.0 libxkbcommon.so || { rm -f libxkbcommon.so && ln -s libxkbcommon.so.0.0.0 libxkbcommon.so; }; })
libtool: install: /usr/bin/install -c .libs/libxkbcommon.lai /usr/local/lib/libxkbcommon.la
libtool: install: /usr/bin/install -c .libs/libxkbcommon.a /usr/local/lib/libxkbcommon.a
libtool: install: chmod 644 /usr/local/lib/libxkbcommon.a
libtool: install: ranlib /usr/local/lib/libxkbcommon.a
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/sbin" ldconfig -n /usr/local/lib
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/local/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
 /bin/mkdir -p '/usr/local/lib/pkgconfig'
 /usr/bin/install -c -m 644 xkbcommon.pc '/usr/local/lib/pkgconfig'
 /bin/mkdir -p '/usr/local/include/xkbcommon'
 /usr/bin/install -c -m 644 xkbcommon/xkbcommon.h xkbcommon/xkbcommon-compat.h xkbcommon/xkbcommon-compose.h xkbcommon/xkbcommon-keysyms.h xkbcommon/xkbcommon-names.h '/usr/local/include/xkbcommon'
make[2]: Leaving directory '/home/tlx/libxkbcommon-0.5.0'
make[1]: Leaving directory '/home/tlx/libxkbcommon-0.5.0'
tlx@TLX001:libxkbcommon-0.5.0$  

参考:解决 QtCreator 3.5.1无法输入中文的问题](https://www.cnblogs.com/oloroso/p/5114041.html#23%E3%80%81libxkbcommon%E9%97%AE%E9%A2%98)

  • 报错4
CMake Error at CMakeLists.txt:36 (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.


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

解决:

tlx@TLX001:build$ sudo apt-get install fcitx-libs-dev -y
正在读取软件包列表... 完成
正在分析软件包的依赖关系树       
正在读取状态信息... 完成       
下列软件包是自动安装的并且现在不需要了:
  aptdaemon aptdaemon-data python-pwquality python3-aptdaemon python3-aptdaemon.gtk3widgets
  python3-defer
使用'sudo apt autoremove'来卸载它(它们)。
下列【新】软件包将被安装:
  fcitx-libs-dev
升级了 0 个软件包,新安装了 1 个软件包,要卸载 0 个软件包,有 22 个软件包未被升级。
需要下载 117 kB 的归档。
解压缩后会消耗 815 kB 的额外空间。
获取:1 http://archive.kylinos.cn/kylin/KYLIN-ALL 10.0/main amd64 fcitx-libs-dev amd64 1:4.2.9.1-1kord1k15 [117 kB]
已下载 117 kB,耗时 0秒 (132 kB/s)       
正在选中未选择的软件包 fcitx-libs-dev。
(正在读取数据库 ... 系统当前共安装有 232810 个文件和目录。)
正准备解包 .../fcitx-libs-dev_1%3a4.2.9.1-1kord1k15_amd64.deb  ...
正在解包 fcitx-libs-dev (1:4.2.9.1-1kord1k15) ...
正在设置 fcitx-libs-dev (1:4.2.9.1-1kord1k15) ...

参考:解决mendeley不能输入中文的情况

  1. cmake的正常输出
tlx@TLX001:build$ cmake ..
-- Checking for module 'fcitx'
--   Found fcitx, version 4.2.9.1
-- Checking for module 'fcitx-config'
--   Found fcitx-config, version 4.2.9.1
-- Checking for module 'fcitx-utils'
--   Found fcitx-utils, version 4.2.9.1
-- fcitx4-config found /usr/bin/fcitx4-config
-- Found Fcitx: 4.2.9.1 (Required is at least version "4.2.8") 
-- Looking for dgettext
-- Looking for dgettext - found
-- Found LIBINTL: /usr/include  
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success
-- 
-- The following OPTIONAL packages have been found:

 * PkgConfig

-- The following REQUIRED packages have been found:

 * ECM (required version >= 1.4.0)
 * Qt5DBus
 * Qt5Widgets
 * Qt5Concurrent
 * Qt5 (required version >= 5.1.0)
 * Qt5Gui (required version >= 5.1.0)
 * XKBCommon (required version >= 0.5.0) , Keyboard handling library using XKB data , <http://xkbcommon.org>
 * Fcitx (required version >= 4.2.8)
 * LibIntl
 * Qt5Core

-- Configuring done
-- Generating done
-- Build files have been written to: /home/tlx/fcitx-qt5/build
tlx@TLX001:build$
  1. make -j8 报错处理
/home/tlx/fcitx-qt5/platforminputcontext/main.h:32: Parse error at "IID"
AUTOGEN: error: process for /home/tlx/fcitx-qt5/build/platforminputcontext/moc_main.cpp failed:
/home/tlx/fcitx-qt5/platforminputcontext/main.h:32: Parse error at "IID"

Generating moc_qfcitxplatforminputcontext.cpp
Generating moc_fcitxqtinputmethodproxy.cpp
Generating moc_fcitxqtconfiguiwidget.cpp
Generating moc_filelistmodel.cpp
Generating moc_fcitxqtkeysequencewidget_p.cpp
moc failed...
platforminputcontext/CMakeFiles/fcitxplatforminputcontextplugin_automoc.dir/build.make:57: recipe for target 'platforminputcontext/CMakeFiles/fcitxplatforminputcontextplugin_automoc' failed
make[2]: *** [platforminputcontext/CMakeFiles/fcitxplatforminputcontextplugin_automoc] Error 1
CMakeFiles/Makefile2:962: recipe for target 'platforminputcontext/CMakeFiles/fcitxplatforminputcontextplugin_automoc.dir/all' failed
make[1]: *** [platforminputcontext/CMakeFiles/fcitxplatforminputcontextplugin_automoc.dir/all] Error 2
make[1]: *** 正在等待未完成的任务....
Generating moc_main.cpp
Generating moc_fcitxqtkeyboardproxy.cpp
Generating moc_model.cpp
[ 22%] Built target FcitxQt5WidgetsAddons_automoc
[ 22%] Built target FcitxQt5DBusAddons_automoc
[ 22%] Built target fcitx-quickphrase-editor5_automoc
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

解决:

使用参考1里面的方法并没有解决,在参考二的文章中看到,我觉得和cmake的参数有关系,参数命令:
进入fcitx-qt5/build目录下

cmake -DCMAKE_PREFIX_PATH=<your_qt_path>/Qt5.6.2/5.6/gcc_64/lib -DECM_DIR=<your_qt_path> ..

cd ..

make

sudo make install

在make的时候, 又出现了报错

参考:

  1. make 报错处理
[ 88%] Building CXX object platforminputcontext/CMakeFiles/fcitxplatforminputcontextplugin.dir/qfcitxplatforminputcontext.cpp.o
/home/tlx/fcitx-qt5/platforminputcontext/qfcitxplatforminputcontext.cpp: In member function ‘virtual void QFcitxPlatformInputContext::setFocusObject(QObject*)’:
/home/tlx/fcitx-qt5/platforminputcontext/qfcitxplatforminputcontext.cpp:308:33: error: no matching function for call to ‘QMetaObject::invokeMethod(QFcitxPlatformInputContext*, QFcitxPlatformInputContext::setFocusObject(QObject*)::<lambda()>, Qt::ConnectionType)’
             Qt::QueuedConnection);
                                 ^
In file included from /opt/DSafeShare/Qt5.9.9/5.9.9/gcc_64/include/QtCore/qmetatype.h:49:0,
                 from /opt/DSafeShare/Qt5.9.9/5.9.9/gcc_64/include/QtDBus/qtdbusglobal.h:44,
                 from /opt/DSafeShare/Qt5.9.9/5.9.9/gcc_64/include/QtDBus/qdbusconnection.h:44,
                 from /opt/DSafeShare/Qt5.9.9/5.9.9/gcc_64/include/QtDBus/QDBusConnection:1,
                 from /home/tlx/fcitx-qt5/platforminputcontext/qfcitxplatforminputcontext.cpp:21:
/opt/DSafeShare/Qt5.9.9/5.9.9/gcc_64/include/QtCore/qobjectdefs.h:406:17: note: candidate: static bool QMetaObject::invokeMethod(QObject*, const char*, Qt::ConnectionType, QGenericReturnArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument)
     static bool invokeMethod(QObject *obj, const char *member,
                 ^
/opt/DSafeShare/Qt5.9.9/5.9.9/gcc_64/include/QtCore/qobjectdefs.h:406:17: note:   candidate expects 14 arguments, 3 provided

解决:
vim /home/tlx/fcitx-qt5/platforminputcontext/qfcitxplatforminputcontext.cpp +308

        proxy->focusIn();
        // We need to delegate this otherwise it may cause self-recursion in
        // certain application like libreoffice.
//        auto window = m_lastWindow;
//        QMetaObject::invokeMethod(
//            this,
//            [this, window]() {
//                if (window != m_lastWindow) {
//                    return;
//                }
//                if (validICByWindow(window.data())) {
//                    cursorRectChanged();
//                }
//            },
//            Qt::QueuedConnection);
将auto之后的12行注释掉

参考:Ubuntu下QT 无法中文输入时 编译libfcitxplatforminputcontextplugin动态库

此处修改完了,make通过,此时就生成了so

[ 82%] Building CXX object platforminputcontext/CMakeFiles/fcitxplatforminputcontextplugin.dir/fcitxplatforminputcontextplugin_automoc.cpp.o
[ 83%] Linking CXX shared module libfcitxplatforminputcontextplugin.so
[100%] Built target fcitxplatforminputcontextplugin

不需要执行make install,将so复制到qt的插件里面

tlx@TLX001:platforminputcontext$ sudo cp libfcitxplatforminputcontextplugin.so /opt/DSafeShare/Qt5.9.9/5.9.9/gcc_64/plugins/platforminputcontexts/
tlx@TLX001:platforminputcontext$ sudo cp libfcitxplatforminputcontextplugin.so /opt/DSafeShare/Qt5.9.9/Tools/QtCreator/lib/Qt/plugins/platforminputcontexts/

然后重启qtcreator,终于解决,qt可以输入中文了。终于。

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

WenCoo

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值