解決Qt5 Creator無法切換輸入法(fcitx),Ubuntu中不能使用搜狗輸入法錄入漢字問題
標簽(空格分隔): 未分類
概述
你我當然不是第一個遇到這個問題的人,網上一搜一堆解決方案。不過注意環境,Qt版本等等。
我的是2016-04-09 下載的 Qt5.6.0, 我的安裝根目錄為 /opt/Qt5.6.0/
, 下面我們將要用到
/opt/Qt5.6.0/5.6/gcc_64/plugins/platforminputcontexts/
和
/opt/Qt5.6.0/Tools/QtCreator/lib/Qt/plugins/platforminputcontexts/
(千萬注意這個目錄是 Qt5.6 的, 你找別的老教程的目錄是錯的,沒有老的目錄了,我還自己建了一個,真蠢)
這兩個目錄,
(我的計算機是Ubuntu14.10 64bit, gcc4.8)
$ sudo apt-get install fcitx-libs-dev
$ export PATH="/opt/Qt5.6.0/5.6/gcc_64/bin":$PATH
$ git clone git@github.com:fcitx/fcitx-qt5.git
cd fcitx-qt5
mkdir build && cd build
cmake ..
make && sudo make install
cp
fcitx-qt5/build/下的 platforminputcontext/libfcitxplatforminputcontextplugin.so
到 /opt/Qt5.6.0/5.6/gcc_64/plugins/platforminputcontexts/
和
/opt/Qt5.6.0/Tools/QtCreator/lib/Qt/plugins/platforminputcontexts/
這兩個目錄,
重啟qtcreator即可。
編譯fcitx-qt5的問題
主要是缺少各種各樣的依賴項
缺少 "ECM"
報錯信息:
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!
solution:
wget https://launchpadlibrarian.net/189487929/extra-cmake-modules_1.4.0.orig.tar.xz
tar -xJf extra-cmake-modules_1.4.0.orig.tar.xz
找不到Qt5包配置文件的錯誤
報錯信息:
CMake Error at CMakeLists.txt:29 (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/o/fcitx/fcitx-qt5/build/CMakeFiles/CMakeOutput.log".
solution:
cmake -DQt5_DIR=/home/o/program/qt_5.5/qt_5.5.1_x64/5.5/gcc_64/lib/cmake/Qt5 ..
找不到libxkbcommon
報錯信息:
solution:
http://xkbcommon.org/download/libxkbcommon-0.5.0.tar.xz
tar -xJf libxkbcommon-0.5.0.tar.xz
這個使用./configure --disable-x11
來生成 Makefile(我的計算機是Ubuntu14.10 64bit, gcc4.8)
編譯需要 yacc
的支持。這個工具包含在軟件包 bison
中。