NVIDIA / Q2RTX

NVIDIA’s implementation of RTX ray-tracing in Quake II
Other
1.22k stars 183 forks source link

Linux - Can't link after compilation - SDL 2 and XWayland issue? #231

Open BielBdeLuna opened 2 years ago

BielBdeLuna commented 2 years ago

here is the ending of the compilation:

[ 95%] Linking CXX executable ../../q2rtx
/usr/bin/ld: ../extern/SDL2/libSDL2.a(SDL_waylandvideo.c.o): in function `wl_display_get_registry':
/home/biel/code/quake/quake2/Q2RTX/build/extern/SDL2/wayland-generated-protocols/wayland-client-protocol.h:1032: undefined reference to `wl_proxy_marshal_flags'
/usr/bin/ld: ../extern/SDL2/libSDL2.a(SDL_waylandvideo.c.o): in function `xdg_wm_base_destroy':
/home/biel/code/quake/quake2/Q2RTX/build/extern/SDL2/wayland-generated-protocols/xdg-shell-client-protocol.h:482: undefined reference to `wl_proxy_marshal_flags'
/usr/bin/ld: /home/biel/code/quake/quake2/Q2RTX/build/extern/SDL2/wayland-generated-protocols/xdg-shell-client-protocol.h:482: undefined reference to `wl_proxy_marshal_flags'
/usr/bin/ld: ../extern/SDL2/libSDL2.a(SDL_waylandvideo.c.o): in function `wl_registry_bind':
/home/biel/code/quake/quake2/Q2RTX/build/extern/SDL2/wayland-generated-protocols/wayland-client-protocol.h:1145: undefined reference to `wl_proxy_marshal_flags'
/usr/bin/ld: /home/biel/code/quake/quake2/Q2RTX/build/extern/SDL2/wayland-generated-protocols/wayland-client-protocol.h:1145: undefined reference to `wl_proxy_marshal_flags'
/usr/bin/ld: ../extern/SDL2/libSDL2.a(SDL_waylandvideo.c.o):/home/biel/code/quake/quake2/Q2RTX/build/extern/SDL2/wayland-generated-protocols/wayland-client-protocol.h:1145: more undefined references to `wl_proxy_marshal_flags' follow
collect2: error: ld returned 1 exit status
make[2]: *** [src/CMakeFiles/client.dir/build.make:2952: ../q2rtx] Error 1
make[1]: *** [CMakeFiles/Makefile2:978: src/CMakeFiles/client.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

any idea how to solve it?

res2k commented 2 years ago

This is an SDL issue: https://github.com/libsdl-org/SDL/issues/5088 You probably need to update SDL or disable Wayland support. You could update SDL by locally applying this commit: https://github.com/NVIDIA/Q2RTX/pull/221/commits/a7fea8f68dcff9530d231ebcc31e5da1c961da5c

SpidFightFR commented 2 years ago

This is an SDL issue: libsdl-org/SDL#5088 You probably need to update SDL or disable Wayland support. You could update SDL by locally applying this commit: a7fea8f

Even after trying your modification, it still does the same error... it's weird.

res2k commented 2 years ago

Did you update the submodules (git submodule update --recursive)?

SpidFightFR commented 2 years ago

Did you update the submodules (git submodule update --recursive)?

Yes, i tried it, but it doesn't seem to work.

BielBdeLuna commented 2 years ago

Q2RTX uses a SDL that it's not the official and hasn't been updated since 2021 it should use: https://github.com/libsdl-org/SDL.git I changed the .gitmodules file the section of SDL2 to:

[submodule "extern/SDL2"]
    path = extern/SDL2
    url = https://github.com/libsdl-org/SDL.git

then I deleted ./extern/SDL2/ then git submodule sync and git submodule update and eventually: git pull --recurse-submodules

But despite the effort this still doesn't solve the issue. Now at least Q2RTX uses an up to date SDL2!

BielBdeLuna commented 2 years ago

did a pull request: https://github.com/NVIDIA/Q2RTX/pull/238

but still the error of this issue remains...

SpidFightFR commented 2 years ago

I hope this issue will be solved soon

SpidFightFR commented 2 years ago

Okay so, i followed the pr #221, then added the change in #238 and ran all the command mentioned by @BielBdeLuna and it worked !

TheRedstoneDEV-DE commented 2 years ago

I've also found another solution (worked at least in my case). Just delete the SDL2 folder in the extern folder. Clone the repository mentioned in a7fea8f (on the right side) and rename it to SDL2.

Changing this line in the .gitmodules file does nothing because the link of the repository (of SDL2) is also stored in the .git folder and (at least I think) read from there.

I found this out, because I cloned this repository without --recursive, changed the .gitmodules file and ran git submodule update --init --recursive In the output it printed the old URL, not the new one, I changed it to.

I hope I could help you a bit. I know, there is already a solution, but I think this one is a bit easier.

BielBdeLuna commented 1 year ago

this error persist, it's not related to the SDL2 change, it still reads:

[ 95%] Linking CXX executable /home/biel/code/quake/quake2/Q2RTX/q2rtx
/usr/bin/ld: ../extern/SDL2/libSDL2.a(SDL_waylandvideo.c.o): in function `wl_display_get_registry':
/home/biel/code/quake/quake2/Q2RTX/build/extern/SDL2/wayland-generated-protocols/wayland-client-protocol.h:1032: undefined reference to `wl_proxy_marshal_flags'
/usr/bin/ld: ../extern/SDL2/libSDL2.a(SDL_waylandvideo.c.o): in function `xdg_wm_base_destroy':
/home/biel/code/quake/quake2/Q2RTX/build/extern/SDL2/wayland-generated-protocols/xdg-shell-client-protocol.h:482: undefined reference to `wl_proxy_marshal_flags'
/usr/bin/ld: /home/biel/code/quake/quake2/Q2RTX/build/extern/SDL2/wayland-generated-protocols/xdg-shell-client-protocol.h:482: undefined reference to `wl_proxy_marshal_flags'
/usr/bin/ld: ../extern/SDL2/libSDL2.a(SDL_waylandvideo.c.o): in function `wl_registry_bind':
/home/biel/code/quake/quake2/Q2RTX/build/extern/SDL2/wayland-generated-protocols/wayland-client-protocol.h:1145: undefined reference to `wl_proxy_marshal_flags'
/usr/bin/ld: /home/biel/code/quake/quake2/Q2RTX/build/extern/SDL2/wayland-generated-protocols/wayland-client-protocol.h:1145: undefined reference to `wl_proxy_marshal_flags'
/usr/bin/ld: ../extern/SDL2/libSDL2.a(SDL_waylandvideo.c.o):/home/biel/code/quake/quake2/Q2RTX/build/extern/SDL2/wayland-generated-protocols/wayland-client-protocol.h:1145: more undefined references to `wl_proxy_marshal_flags' follow
collect2: error: ld returned 1 exit status
make[2]: *** [src/CMakeFiles/client.dir/build.make:2952: /home/biel/code/quake/quake2/Q2RTX/q2rtx] Error 1
make[1]: *** [CMakeFiles/Makefile2:978: src/CMakeFiles/client.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

I can compile SDL2 from that repository individually without any trouble, it's got to be Q2 RTX implementation

gel-crabs commented 1 year ago

It's due to SDL switching to the SDL3 branch by default, if you clone the repo with git clone -b SDL2 https://github.com/libsdl-org/SDL.git SDL2 It compiles fine again.

Note: If you want to clone the latest supported version of SDL2, clone the repo with: git clone -b release-2.0.22 https://github.com/libsdl-org/SDL.git SDL2