Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
BielBdeLuna opened this issue Jun 4, 2022 · 11 comments
Open

Comments

@BielBdeLuna
Copy link
Contributor

BielBdeLuna commented Jun 4, 2022

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
Copy link
Contributor

res2k commented Jun 4, 2022

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

@SpidFightFR
Copy link

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
Copy link
Contributor

res2k commented Jul 17, 2022

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

@SpidFightFR
Copy link

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

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

@BielBdeLuna
Copy link
Contributor Author

BielBdeLuna commented Aug 13, 2022

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
Copy link
Contributor Author

BielBdeLuna commented Aug 13, 2022

did a pull request: #238

but still the error of this issue remains...

@SpidFightFR
Copy link

I hope this issue will be solved soon

@SpidFightFR
Copy link

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
Copy link

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
Copy link
Contributor Author

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
Copy link

gel-crabs commented Dec 24, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants