ValveSoftware / gamescope

SteamOS session compositing window manager
Other
3.03k stars 199 forks source link

Build error (link error) on version 3.14.5 #1271

Open Algorithm0 opened 5 months ago

Algorithm0 commented 5 months ago

OS: Fedora 40 Workstation Compiler: gcc (GCC) 14.0.1 20240411 (Red Hat 14.0.1-0) Gamescope versions: 3.14.5 (6a73edd) Build commands (after fix):

meson build/
ninja -C build/

Errors:

ninja: Entering directory `build'
[475/475] Linking target src/gamescope
FAILED: src/gamescope 
c++  -o src/gamescope src/gamescope.p/meson-generated_.._.._protocol_linux-dmabuf-v1-protocol.c.o src/gamescope.p/meson-generated_.._.._protocol_viewporter-protocol.c.o src/gamescope.p/meson-generated_.._.._protocol_xdg-shell-protocol.c.o src/gamescope.p/meson-generated_.._.._protocol_presentation-time-protocol.c.o src/gamescope.p/meson-generated_.._.._protocol_single-pixel-buffer-v1-protocol.c.o src/gamescope.p/meson-generated_.._.._protocol_pointer-constraints-unstable-v1-protocol.c.o src/gamescope.p/meson-generated_.._.._protocol_relative-pointer-unstable-v1-protocol.c.o src/gamescope.p/meson-generated_.._.._protocol_fractional-scale-v1-protocol.c.o src/gamescope.p/meson-generated_.._.._protocol_frog-color-management-v1-protocol.c.o src/gamescope.p/meson-generated_.._.._protocol_gamescope-xwayland-protocol.c.o src/gamescope.p/meson-generated_.._.._protocol_gamescope-pipewire-protocol.c.o src/gamescope.p/meson-generated_.._.._protocol_gamescope-input-method-protocol.c.o src/gamescope.p/meson-generated_.._.._protocol_gamescope-control-protocol.c.o src/gamescope.p/meson-generated_.._.._protocol_gamescope-swapchain-protocol.c.o src/gamescope.p/steamcompmgr.cpp.o src/gamescope.p/convar.cpp.o src/gamescope.p/color_helpers.cpp.o src/gamescope.p/main.cpp.o src/gamescope.p/edid.cpp.o src/gamescope.p/headless.cpp.o src/gamescope.p/wlserver.cpp.o src/gamescope.p/vblankmanager.cpp.o src/gamescope.p/rendervulkan.cpp.o src/gamescope.p/log.cpp.o src/gamescope.p/ime.cpp.o src/gamescope.p/mangoapp.cpp.o src/gamescope.p/reshade_effect_manager.cpp.o src/gamescope.p/backend.cpp.o src/gamescope.p/wayland_backend.cpp.o src/gamescope.p/InputEmulation.cpp.o src/gamescope.p/drm.cpp.o src/gamescope.p/modegen.cpp.o src/gamescope.p/sdlwindow.cpp.o src/gamescope.p/pipewire.cpp.o src/gamescope.p/vr_session.cpp.o src/gamescope.p/reshade_source_effect_codegen_spirv.cpp.o src/gamescope.p/reshade_source_effect_expression.cpp.o src/gamescope.p/reshade_source_effect_lexer.cpp.o src/gamescope.p/reshade_source_effect_parser_exp.cpp.o src/gamescope.p/reshade_source_effect_parser_stmt.cpp.o src/gamescope.p/reshade_source_effect_preprocessor.cpp.o src/gamescope.p/reshade_source_effect_symbol_table.cpp.o -Wl,--as-needed -Wl,--no-undefined -Wl,-rpath,/usr/local/lib64 -Wl,-rpath-link,/usr/local/lib64 -Wl,--start-group subprojects/wlroots/libwlroots.a subprojects/libliftoff/libliftoff.a subprojects/libdisplay-info/libdisplay-info.a subprojects/openvr/libopenvr_api.a /usr/lib64/libwayland-client.so /usr/lib64/libX11.so /usr/lib64/libXdamage.so /usr/lib64/libXfixes.so /usr/lib64/libXcomposite.so /usr/lib64/libXrender.so /usr/lib64/libXext.so /usr/lib64/libXxf86vm.so /usr/lib64/libXRes.so /usr/lib64/libdrm.so /usr/lib64/libwayland-server.so /usr/lib64/libxkbcommon.so -pthread /usr/lib64/libSDL2.so /usr/lib64/libpixman-1.so -lm -lrt /usr/lib64/libudev.so /usr/lib64/libseat.so /usr/lib64/libinput.so /usr/lib64/libxcb.so /usr/lib64/libxcb-composite.so /usr/lib64/libxcb-ewmh.so /usr/lib64/libxcb-icccm.so /usr/lib64/libxcb-render.so /usr/lib64/libxcb-res.so /usr/lib64/libxcb-xfixes.so /usr/lib64/libxcb-errors.so /usr/lib64/libvulkan.so /usr/lib64/libXtst.so /usr/lib64/libXmu.so /usr/lib64/libXt.so /usr/lib64/libcap.so /usr/lib64/libpipewire-0.3.so /usr/lib64/libXcursor.so /usr/local/lib64/libavif.so /usr/lib64/libXi.so /usr/lib64/libdecor-0.so -Wl,--end-group
/usr/bin/ld: src/gamescope.p/wlserver.cpp.o: в функции «std::default_delete<gamescope::GamescopeInputServer>::operator()(gamescope::GamescopeInputServer*) const»:
/usr/include/c++/14/bits/unique_ptr.h:93:(.text._ZNKSt14default_deleteIN9gamescope20GamescopeInputServerEEclEPS1_[_ZNKSt14default_deleteIN9gamescope20GamescopeInputServerEEclEPS1_]+0x1d): undefined reference to `gamescope::GamescopeInputServer::~GamescopeInputServer()'
collect2: ошибка: выполнение ld завершилось с кодом возврата 1
ninja: build stopped: subcommand failed.
sharkautarch commented 5 months ago

@Algorithm0

I've often had linker errors when re-building gamescope if I'm not building from scratch Try doing: (I'm adding an optional --buildtype=debugoptimized because otherwise compiler optimizations are off by default)

meson setup build --reconfigure --wipe --buildtype=debugoptimized
git submodule update
ninja -C build
Algorithm0 commented 5 months ago

@Algorithm0

I've often had linker errors when re-building gamescope if I'm not building from scratch Try doing: (I'm adding an optional --buildtype=debugoptimized because otherwise compiler optimizations are off by default)

meson setup build --reconfigure --wipe --buildtype=debugoptimized
git submodule update
ninja -C build

I tried what you said, but unfortunately it didn't help. I see the same error with destructor not found.

Algorithm0 commented 5 months ago

Yeah! I found the problem. My repository was missing the libeis-devel package. It’s strange that the meson didn’t tell me this during configuration. I found two interesting lines in the src/meson.build:

...
eis_dep = dependency('libeis-1.0', required : get_option('input_emulation'))
...
gamescope_cpp_args += '-DHAVE_LIBEIS=@0@'.format(eis_dep.found().to_int())
...

At the same time, the entire file src/InputEmulation.cpp is surrounded by #if HAVE_LIBEIS. And this file contains the definition of the destructor, and all the methods for the GamescopeInputServer class.

Correction suggestion: Fix src/meson.build so that a configuration error is thrown if there is no dependency "libeis"