Score:1

Ubuntu 22.04.1 LTS SDL2 wl_proxy_marshal_flags error

ms flag

I'm a beginner at using Linux, so I'm following a couple of forum threads I've read so far.

I'm trying to compile a C++ program using g++ version 11.3.1, where I have installed SDL2 using the command sudo apt-get install libsdl2-dev and am using the recommended proprietary driver nvidia-driver-525 for my nvidia gtx 1060 graphics card. When I echo $XDG_SESSION_TYPE, it says x11.

However, when I compile the program using the link arguments -lSDL2, it gives me the following compile error:

/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/libSDL2.so: undefined reference to `wl_proxy_marshal_flags'
collect2: error: ld returned 1 exit status

When I compile the program with the link arguments: -lSDL2 -lwayland-egl -lwayland-client -lwayland-cursor, it compiles successfully. But then when I try to run the program, it gives me this error:

./bin/main.exe: symbol lookup error: /usr/lib/x86_64-linux-gnu/libdecor-0.so.0: undefined symbol: wl_proxy_marshal_flags
hr flag
This is just a guess, but I wonder if because [Wayland is the default for Ubuntu 22.04](https://www.ghacks.net/2022/04/21/ubuntu-22-04-lts-with-gnome-42-and-wayland-as-the-default/), the SDL2 library is also built with `SDL_VIDEODRIVER=wayland` and you need to set `SDL_VIDEODRIVER=x11` explicitly in your environment if that's what you're using? See [How do I choose a specific video driver?](https://wiki.libsdl.org/SDL2/FAQUsingSDL)
Fognam1n avatar
ms flag
@steeldriver I tried compiling and running with `SDL_VIDEODRIVER=x11` prepended but to no avail. I read something about how SDL2 released a version that defaulted to wayland, but later on reverted that decision due to issues with nvidia and such. Maybe I have the wrong SDL2 version installed?
hr flag
Did you compile and link from scratch (i.e. remove any intermediate .o files) when you did that?
Fognam1n avatar
ms flag
@steeldriver I've tried it both ways already (with and without .o files), and they produced the same result.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.