Riey / kime

Korean IME
GNU General Public License v3.0
523 stars 53 forks source link

Unable to build: `Parse error at "IID"` #632

Closed scarf005 closed 1 year ago

scarf005 commented 1 year ago

Steps to reproduce

follow https://github.com/Riey/kime#manual-build. I'm suspecting it's because QT6 isn't installed.

System Info

Operating System: Kubuntu 23.04
KDE Plasma Version: 5.27.4
KDE Frameworks Version: 5.104.0
Qt Version: 5.15.8
Kernel Version: 6.3.1-060301-generic (64-bit)
Graphics Platform: X11

Error log

Details warning: the following packages contain code that will be rejected by a future version of Rust: daemonize v0.4.1 note: to see what the problems were, use the option `--future-incompat-report`, or run `cargo report future-incompatibilities --id 1` cp: './target/release/kime-xim' 상태 정보 확인 불가: 그런 파일이나 디렉터리가 없습니다mkdir: 'build/cmake' 디렉터리를 만들었습니다Build gtk qt immodules... -- The C compiler identification is GNU 12.2.0 -- The CXX compiler identification is GNU 12.2.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/lib/ccache/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/lib/ccache/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found PkgConfig: /usr/bin/pkg-config (found version "1.8.1") -- Checking for module 'gtk+-3.0' -- Package 'gtk+-3.0', required by 'virtual:world', not found -- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so -- Performing Test HAVE_STDATOMIC -- Performing Test HAVE_STDATOMIC - Success -- Configuring done -- Generating done -- Build files have been written to: /home/scarf/opt/kime/build/cmake [ 20%] Automatic MOC and UIC for target kime-qt5 [ 20%] Automatic MOC and UIC for target kime-qt6 [ 20%] Built target kime-qt5_autogen AutoMoc subprocess error ------------------------ The moc process failed to compile "SRC:/frontends/qt5/src/plugin.hpp" into "BIN:/frontends/qt6/kime-qt6_autogen/RQQC373JEC/moc_plugin.cpp" Command ------- /usr/lib/qt6/libexec/moc -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NO_DEBUG -Dkime_qt6_EXPORTS -I/usr/include/x86_64-linux-gnu/qt6/QtGui/6.4.2 -I/usr/include/x86_64-linux-gnu/qt6/QtGui/6.4.2/QtGui -I/usr/include/x86_64-linux-gnu/qt6/QtCore/6.4.2 -I/usr/include/x86_64-linux-gnu/qt6/QtCore/6.4.2/QtCore -I/usr/include/x86_64-linux-gnu/qt6/QtDBus/6.4.2 -I/usr/include/x86_64-linux-gnu/qt6/QtDBus/6.4.2/QtDBus -I/home/scarf/opt/kime/src/engine/cffi -I/usr/include/x86_64-linux-gnu/qt6/QtGui -I/usr/include/x86_64-linux-gnu/qt6 -I/usr/include/x86_64-linux-gnu/qt6/QtCore -I/usr/lib/x86_64-linux-gnu/qt6/mkspecs/linux-g++ -I/usr/include -I/usr/include/c++/12 -I/usr/include/x86_64-linux-gnu/c++/12 -I/usr/include/c++/12/backward -I/usr/lib/gcc/x86_64-linux-gnu/12/include -I/usr/local/include -I/usr/include/x86_64-linux-gnu --include /home/scarf/opt/kime/build/cmake/frontends/qt6/kime-qt6_autogen/moc_predefs.h --output-dep-file -o /home/scarf/opt/kime/build/cmake/frontends/qt6/kime-qt6_autogen/RQQC373JEC/moc_plugin.cpp /home/scarf/opt/kime/src/frontends/qt5/src/plugin.hpp Output ------ /home/scarf/opt/kime/src/frontends/qt5/src/plugin.hpp:11:1: error: Parse error at "IID" [ 50%] Building CXX object frontends/qt5/CMakeFiles/kime-qt5.dir/src/plugin.cc.o [ 50%] Building CXX object frontends/qt5/CMakeFiles/kime-qt5.dir/src/input_context.cc.o [ 50%] Building CXX object frontends/qt5/CMakeFiles/kime-qt5.dir/kime-qt5_autogen/mocs_compilation.cpp.o make[2]: *** [frontends/qt6/CMakeFiles/kime-qt6_autogen.dir/build.make:71: frontends/qt6/CMakeFiles/kime-qt6_autogen] 오류 1 make[1]: *** [CMakeFiles/Makefile2:232: frontends/qt6/CMakeFiles/kime-qt6_autogen.dir/all] 오류 2 make[1]: *** 끝나지 않은 작업을 기다리고 있습니다.... [ 60%] Linking CXX shared library ../../lib/libkime-qt5.so [ 60%] Built target kime-qt5 make: *** [Makefile:91: all] 오류 2
Riey commented 1 year ago

Can you show me the command that causes those errors?

scarf005 commented 1 year ago

could you clarify? i followed the exact step mentioned in https://github.com/Riey/kime#manual-build, that is:

git clone https://github.com/Riey/kime
cd kime

scripts/build.sh -ar
Riey commented 1 year ago

I think your problem is missing some dependencies from qt5-default qtbase5-dev qtbase5-private-dev libqt5gui5

Make sure you have installed all of these.

scarf005 commented 1 year ago
$ sudo nala install qt5-default qtbase5-dev qtbase5-private-dev libqt5gui5
libqt5gui5 is already at the latest version 5.15.8+dfsg-3
qtbase5-dev is already at the latest version 5.15.8+dfsg-3
qtbase5-private-dev is already at the latest version 5.15.8+dfsg-3
Error: qt5-default has no installation candidate.

qt5-default was obsoleted, so tried to install following dependencies as suggested in https://askubuntu.com/a/1335187/1663620:

sudo apt-get install qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools
패키지 목록을 읽는 중입니다... 완료
의존성 트리를 만드는 중입니다... 완료
상태 정보를 읽는 중입니다... 완료        
패키지 qtbase5-dev는 이미 최신 버전입니다 (5.15.8+dfsg-3).
패키지 qtchooser는 이미 최신 버전입니다 (66-2build1).
qtchooser 패키지는 수동설치로 지정합니다.
패키지 qt5-qmake는 이미 최신 버전입니다 (5.15.8+dfsg-3).
qt5-qmake 패키지는 수동설치로 지정합니다.
패키지 qtbase5-dev-tools는 이미 최신 버전입니다 (5.15.8+dfsg-3).
qtbase5-dev-tools 패키지는 수동설치로 지정합니다.
0개 업그레이드, 0개 새로 설치, 0개 제거 및 0개 업그레이드 안 함.
~/o/kime   develop  sudo nala install qttools5-dev-tools               1199ms  2023년 05월 06일 (토) 오후 09시 29분 25초qttools5-dev-tools is already at the latest version 5.15.8-2
Nothing for Nala to do.

all these dependencies were already installed yet it doesn't work.

Riey commented 1 year ago

You're right. It's the problem from Qt6. I'm just confused because cmake script checks whether Qt6 is installed or not. But it seems to only check the core library, which may be installed on your computer but not the qt6-base-private-dev or something important library.

IMO, the solution is to install both qt6-base-dev and qt6-base-private-dev, then build will be successful, including qt6.

scarf005 commented 1 year ago
Error: gt6-base-dev not found

could build the binary after installing qt6-base-private-dev. thanks for the help!

Build Log ``` !  ~/o/kime   develop  ./scripts/build.sh 585ms  2023년 05월 06일 (토) 오후 09시 32분 39초Build rust pkgs ./scripts/build.sh: 행 117번: [: : 정수 표현식 필요함 Finished release [optimized] target(s) in 0.07s cp: './target/release/kime-xim' 상태 정보 확인 불가: 그런 파일이나 디렉터리가 없습니다Build gtk qt immodules... -- Checking for module 'gtk+-3.0' -- Package 'gtk+-3.0', required by 'virtual:world', not found -- Configuring done -- Generating done -- Build files have been written to: /home/scarf/opt/kime/build/cmake [ 20%] Automatic MOC and UIC for target kime-qt6 [ 20%] Automatic MOC and UIC for target kime-qt5 [ 20%] Built target kime-qt5_autogen [ 60%] Built target kime-qt5 [ 60%] Built target kime-qt6_autogen [ 90%] Building CXX object frontends/qt6/CMakeFiles/kime-qt6.dir/kime-qt6_autogen/mocs_compilation.cpp.o [ 90%] Building CXX object frontends/qt6/CMakeFiles/kime-qt6.dir/__/qt5/src/input_context.cc.o [ 90%] Building CXX object frontends/qt6/CMakeFiles/kime-qt6.dir/__/qt5/src/plugin.cc.o /home/scarf/opt/kime/src/frontends/qt5/src/input_context.cc: In member function ‘void KimeInputContext::preedit_str(kime::RustStr)’: /home/scarf/opt/kime/src/frontends/qt5/src/input_context.cc:102:65: warning: narrowing conversion of ‘qs.QString::length()’ from ‘qsizetype’ {aka ‘long long int’} to ‘int’ [-Wnarrowing] 102 | QInputMethodEvent::AttributeType::TextFormat, 0, qs.length(), fmt}); | ~~~~~~~~~^~ [100%] Linking CXX shared library ../../lib/libkime-qt6.so [100%] Built target kime-qt6 ```