matinlotfali / KDE-Rounded-Corners

Rounds the corners of your windows in KDE Plasma 5 and 6
GNU General Public License v3.0
638 stars 22 forks source link

Build fails on Gentoo Linux (undefined references) #286

Open HyperWinX opened 1 month ago

HyperWinX commented 1 month ago

Trying to build it on Gentoo. CMake said that all requirements are satisfied, but on building stage it throwed some undefined references. Here is some versions of packages from CMake output:

-- Found KF6ConfigWidgets: /usr/lib64/cmake/KF6ConfigWidgets/KF6ConfigWidgetsConfig.cmake (found version "6.7.0")
-- Found KF6: success (found suitable version "6.7.0", minimum required is "6") found components: ConfigWidgets
-- Found KF6KCMUtils: /usr/lib64/cmake/KF6KCMUtils/KF6KCMUtilsConfig.cmake (found version "6.7.0")
-- Found KF6: success (found suitable version "6.7.0", minimum required is "6") found components: KCMUtils
-- Found XKB: /usr/lib64/libxkbcommon.so (found suitable version "1.7.0", minimum required is "0.5.0")
-- Found X11: /usr/include
-- Found Wayland_Server: /usr/lib64/libwayland-server.so (found version "1.23.1")
-- Found Wayland: /usr/lib64/libwayland-server.so (found version "1.23.1") found components: Server
-- Found epoxy: /usr/lib64/libepoxy.so (found version "1.5.10")
-- Found KWin Version: 6.2.1
-- Found KWinEffect API Version: 236
-- Found XCB_XCB: /usr/lib64/libxcb.so (found version "1.17.0")
-- Found XCB: /usr/lib64/libxcb.so (found version "1.17.0") found components: XCB

Build log:

❯ cmake --build . -j
[  0%] Built target kwin4_effect_shapecorners_autogen_timestamp_deps
[  4%] Merging shapecorners.glsl: shapecorners.frag and shapecorners_core.frag
[  4%] Built target kwin_shapecorners_config_autogen_timestamp_deps
[  9%] Automatic MOC for target kwin4_effect_shapecorners
[  9%] Built target shaders
[ 13%] Automatic MOC for target kwin_shapecorners_config
[ 13%] Built target kwin_shapecorners_config_autogen
[ 18%] Generating ui_KCM.h
[ 22%] Generating kwineffects_interface.cpp, kwineffects_interface.h
[ 27%] Generating Config.h, Config.cpp
[ 31%] Generating moc_kwineffects_interface.cpp
[ 36%] Building CXX object src/kcm/CMakeFiles/kwin_shapecorners_config.dir/kwin_shapecorners_config_autogen/mocs_compilation.cpp.o
[ 40%] Building CXX object src/kcm/CMakeFiles/kwin_shapecorners_config.dir/KCM.cpp.o
[ 45%] Building CXX object src/kcm/CMakeFiles/kwin_shapecorners_config.dir/kwineffects_interface.cpp.o
[ 50%] Building CXX object src/kcm/CMakeFiles/kwin_shapecorners_config.dir/plugin.cpp.o
[ 54%] Building CXX object src/kcm/CMakeFiles/kwin_shapecorners_config.dir/Config.cpp.o
[ 54%] Built target kwin4_effect_shapecorners_autogen
[ 59%] Generating Config.h, Config.cpp
[ 63%] Building CXX object src/CMakeFiles/kwin4_effect_shapecorners.dir/kwin4_effect_shapecorners_autogen/mocs_compilation.cpp.o
[ 68%] Building CXX object src/CMakeFiles/kwin4_effect_shapecorners.dir/Effect.cpp.o
[ 72%] Building CXX object src/CMakeFiles/kwin4_effect_shapecorners.dir/Shader.cpp.o
[ 81%] Building CXX object src/CMakeFiles/kwin4_effect_shapecorners.dir/Window.cpp.o
[ 77%] Building CXX object src/CMakeFiles/kwin4_effect_shapecorners.dir/TileChecker.cpp.o
[ 86%] Building CXX object src/CMakeFiles/kwin4_effect_shapecorners.dir/plugin.cpp.o
[ 90%] Building CXX object src/CMakeFiles/kwin4_effect_shapecorners.dir/Config.cpp.o
[ 95%] Linking CXX shared module ../bin/kwin/effects/plugins/kwin4_effect_shapecorners.so
/usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: CMakeFiles/kwin4_effect_shapecorners.dir/Effect.cpp.o: in function `ShapeCorners::Effect::prePaintWindow(KWin::EffectWindow*, KWin::WindowPrePaintData&, std::chrono::duration<long, std::ratio<1l, 1000l> >)':
Effect.cpp:(.text+0x17f4): undefined reference to `KWin::Effect::prePaintWindow(KWin::EffectWindow*, KWin::WindowPrePaintData&, std::chrono::duration<long, std::ratio<1l, 1000l> >)'
/usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: CMakeFiles/kwin4_effect_shapecorners.dir/kwin4_effect_shapecorners_autogen/mocs_compilation.cpp.o:(.data.rel.ro._ZTVN12ShapeCorners6EffectE[_ZTVN12ShapeCorners6EffectE]+0x78): undefined reference to `KWin::Effect::prePaintScreen(KWin::ScreenPrePaintData&, std::chrono::duration<long, std::ratio<1l, 1000l> >)'
/usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: CMakeFiles/kwin4_effect_shapecorners.dir/kwin4_effect_shapecorners_autogen/mocs_compilation.cpp.o:(.data.rel.ro._ZTVN12ShapeCorners6EffectE[_ZTVN12ShapeCorners6EffectE]+0xe8): undefined reference to `KWin::Effect::touchDown(int, QPointF const&, std::chrono::duration<long, std::ratio<1l, 1000000l> >)'
/usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: CMakeFiles/kwin4_effect_shapecorners.dir/kwin4_effect_shapecorners_autogen/mocs_compilation.cpp.o:(.data.rel.ro._ZTVN12ShapeCorners6EffectE[_ZTVN12ShapeCorners6EffectE]+0xf0): undefined reference to `KWin::Effect::touchMotion(int, QPointF const&, std::chrono::duration<long, std::ratio<1l, 1000000l> >)'
/usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: CMakeFiles/kwin4_effect_shapecorners.dir/kwin4_effect_shapecorners_autogen/mocs_compilation.cpp.o:(.data.rel.ro._ZTVN12ShapeCorners6EffectE[_ZTVN12ShapeCorners6EffectE]+0xf8): undefined reference to `KWin::Effect::touchUp(int, std::chrono::duration<long, std::ratio<1l, 1000000l> >)'
collect2: error: ld returned 1 exit status
gmake[2]: *** [src/CMakeFiles/kwin4_effect_shapecorners.dir/build.make:208: bin/kwin/effects/plugins/kwin4_effect_shapecorners.so] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:192: src/CMakeFiles/kwin4_effect_shapecorners.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....
[100%] Linking CXX shared module ../../bin/kwin/effects/configs/kwin_shapecorners_config.so
/usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: CMakeFiles/kwin_shapecorners_config.dir/kwineffects_interface.cpp.o: in function `int qRegisterNormalizedMetaTypeImplementation<QList<bool> >(QByteArray const&)':
kwineffects_interface.cpp:(.text._Z41qRegisterNormalizedMetaTypeImplementationI5QListIbEEiRK10QByteArray[_Z41qRegisterNormalizedMetaTypeImplementationI5QListIbEEiRK10QByteArray]+0x125): undefined reference to `QMetaType::registerMutableViewFunction(std::function<bool (void*, void*)> const&, QMetaType, QMetaType)'
/usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: kwineffects_interface.cpp:(.text._Z41qRegisterNormalizedMetaTypeImplementationI5QListIbEEiRK10QByteArray[_Z41qRegisterNormalizedMetaTypeImplementationI5QListIbEEiRK10QByteArray]+0x18d): undefined reference to `QMetaType::registerConverterFunction(std::function<bool (void const*, void*)> const&, QMetaType, QMetaType)'
collect2: error: ld returned 1 exit status
gmake[2]: *** [src/kcm/CMakeFiles/kwin_shapecorners_config.dir/build.make:191: bin/kwin/effects/configs/kwin_shapecorners_config.so] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:271: src/kcm/CMakeFiles/kwin_shapecorners_config.dir/all] Error 2
gmake: *** [Makefile:166: all] Error 2
matinlotfali commented 1 month ago

Oh wow! You are the first person trying it on Gentoo. Errors say the compilation and object file creation are fine, but there is a linker problem which would be related to these lines: https://github.com/matinlotfali/KDE-Rounded-Corners/blob/a802af5a8d9bb1e116c3123877053942017a6e1a/src/CMakeLists.txt#L21-L31

HyperWinX commented 1 month ago

Really? Lol, glad to help you with it. Not sure if reason if errors is missing library or incorrect version. I suppose that incorrect version, because CMake found all dependencies.

matinlotfali commented 1 month ago

Can adjusting your linker help? https://wiki.gentoo.org/wiki/Mold

HyperWinX commented 1 month ago

It uses default ld because GCC. I can try building it with LLVM (ld.lld), but im pretty sure that it won't solve undefined references.

HyperWinX commented 1 month ago

Does it build for you right now? What version of KWin do you have installed? Maybe your version is older than mine, and still has these symbols (mine is 6.2.1-1)

matinlotfali commented 1 month ago

It is fully tested and is being built daily on distros mentioned on the first page README.md

HyperWinX commented 1 month ago

Oh, i see. Okay, i will inspect latest KWin commits and libraries differences later. That's weird.

matinlotfali commented 1 month ago

The latest KWin is provided in KDE Neon (Unstable) which is building fine. So that is why I think there is either a header/library mismatch in Gentoo, or there is a linker issue on Gentoo.

HyperWinX commented 1 month ago

Headers are fine, because compilation stage was passed, and im sure that linker is fine too, because i just built whole chromium with it. This can indicate missing .so files, or missing symbols, I'll take a look later.