I received these messages when configuring my project with CMake:
CMake Warning at ./vcpkg/registries/git-trees/.../portfile.cmake:34 (message):
You will need to install Xorg dependencies to use feature x11:
sudo apt install libx11-dev libxft-dev libxext-dev
Call Stack (most recent call first):
scripts/ports.cmake:206 (include)
CMake Warning at ./vcpkg/registries/git-trees/.../portfile.cmake:37 (message):
You will need to install Wayland dependencies to use feature wayland:
sudo apt install libwayland-dev libxkbcommon-dev libegl1-mesa-dev
Call Stack (most recent call first):
scripts/ports.cmake:206 (include)
CMake Warning at ./vcpkg/registries/git-trees/.../portfile.cmake::40 (message):
You will need to install ibus dependencies to use feature ibus:
sudo apt install libibus-1.0-dev
Call Stack (most recent call first):
scripts/ports.cmake:206 (include)
Completed submission of sdl3[core,ibus,wayland,x11]:x64-linux@3.4.2#1 to 1 binary cache(s) in 1.5 s (1/1)
All requested installations completed successfully in: 1.5 min
: && /usr/bin/c++ -g -pthread -Wl,--dependency-file=CMakeFiles/run.dir/link.d CMakeFiles/run.dir/src/main.cpp.o -o Debug/run vcpkg_installed/x64-linux/debug/lib/libSDL3.a -lm && :
/usr/bin/ld: vcpkg_installed/x64-linux/debug/lib/libSDL3.a(SDL_ime.c.o): in function `InitIME':
./vcpkg/buildtrees/sdl3/.../src/core/linux/SDL_ime.c:75:(.text+0x25): undefined reference to `SDL_IBus_Init'
/usr/bin/ld: ./vcpkg/buildtrees/sdl3/.../src/core/linux/SDL_ime.c:76:(.text+0x33): undefined reference to `SDL_IBus_Quit'
/usr/bin/ld: ./vcpkg/buildtrees/sdl3/.../src/core/linux/SDL_ime.c:77:(.text+0x41): undefined reference to `SDL_IBus_SetFocus'
/usr/bin/ld: ./vcpkg/buildtrees/sdl3/.../src//core/linux/SDL_ime.c:78:(.text+0x4f): undefined reference to `SDL_IBus_Reset'
/usr/bin/ld: ./vcpkg/buildtrees/sdl3/.../src/core/linux/SDL_ime.c:79:(.text+0x5d): undefined reference to `SDL_IBus_ProcessKeyEvent'
/usr/bin/ld: ./vcpkg/buildtrees/sdl3/.../src/core/linux/SDL_ime.c:80:(.text+0x6b): undefined reference to `SDL_IBus_UpdateTextInputArea'
/usr/bin/ld: ./vcpkg/buildtrees/sdl3/.../src/core/linux/SDL_ime.c:81:(.text+0x79): undefined reference to `SDL_IBus_PumpEvents'
I suspect that to correct these errors I would just have to install the mentioned dependencies and restart everything but I still have doubts; especially about this “ibus”. I see that in the vcpkg port it is defined as part of the “default-features”. Does that mean “mandatory” ?
I have tried to disable the “ibus” feature with the command vcpkg add port sdl3[wayland,x11] but it didn’t worked. The guy who have opened the issue say that he have managed to disable it but I’m not sure how he did :
I managed to disable it, when just using SDL3, however with ImGui’s sdl-binding it gets pulled in with default-features again.
Here’s a repository with the setup that I use : SDL_VCPKG_SETUP, I would have liked to provide a Docker image, but I haven’t had time to work on it yet.
For now, I install SDL with a git submodule and it works, so I think the problem comes from the vcpkg’s SDL port.
I was able to compile the example you linked by writing gcc example.c -g -lSDL3
I don’t know if that’s a difference in my distro, or if it’s because I’m not trying to compile with a build system. I never got around to trying to compile with cmake (except that one time I was building sdl3 from source). If your project is one file there’s nothing wrong with skipping a build system. I don’t use a build system for any of my projects (unless my own custom build system counts)
I simply copied paste the example you linked into a c file. I installed SDL3 through my distro package manager (apt or pacman depending on the machine). IIRC SDL was extremely easy to build, maybe you’d have better luck by building it. I never shipped a program linking to the SDL I built so idr if there are any difficulties running on other peoples machines. I usually ship something built from a container or vm, linking only to what distros provide
If you are using vcpkg in classic mode, I think you can disable ibus by installing with: vcpkg install sdl3[core,wayland,x11]
You need to include core, otherwise it will just proceed to install default features.
If this also does not work, I see in the github discussion you posted that users also installed dbus alongside default features. In classic mode, this is:
vcpkg install sdl3[dbus] (and it will install the rest of the default features automatically).
If using vcpkg manifest mode with vcpkg.json, I think you need to include a flag like "default features”: false and then either remove ibus or add dbus.
For me in classic mode, both removing ibus and adding dbus worked in the end.