xmake-io/xmake-repo

Can't run SDL programs

Opened this issue · 0 comments

vsian commented

Xmake Version

xmake v2.9.5

Operating System Version and Architecture

Linux Fedora 6.9.8-100.fc39.x86_64

Describe Bug

I was trying to write a SDL-related program, so I start off by cloning this repository

  1. I set toolchain to clang using. After this xmake runs fine, but when I run the binary, it says there is error initializing SDL.
  2. I tried with the clang off, but this time, it fails to build.

For the first problem, I found something that might help.

Expected Behavior

Everything work fine.

Project Configuration

add_rules("mode.debug", "mode.release")

set_toolchains("clang")
add_requires("libsdl")

target("LearnOpenGL")
    set_kind("binary")
    add_files("src/*.cpp")
    add_packages("libsdl")

Additional Information and Error Logs

Error initializing SDL: dsp: No such audio device
sh: line 1: pause: command not found
error: execv(/home//Documents/Codes/LearnOpenGL/build/linux/x86_64/release/LearnOpenGL ) failed(1)
make[2]: *** [CMakeFiles/SDL2-static.dir/build.make:76: CMakeFiles/SDL2-static.dir/src/SDL.c.o] Error 1
make[2]: *** [CMakeFiles/SDL2-static.dir/build.make:90: CMakeFiles/SDL2-static.dir/src/SDL_assert.c.o] Error 1
In file included from /home//.xmake/cache/packages/2410/l/libsdl/2.30.7/source/src/events/../video/SDL_vulkan_internal.h:61,
                 from /home//.xmake/cache/packages/2410/l/libsdl/2.30.7/source/src/events/../video/SDL_sysvideo.h:32,
                 from /home//.xmake/cache/packages/2410/l/libsdl/2.30.7/source/src/events/SDL_events_c.h:30,
                 from /home//.xmake/cache/packages/2410/l/libsdl/2.30.7/source/src/events/SDL_events.c:28:
/home//.xmake/cache/packages/2410/l/libsdl/2.30.7/source/src/events/../video/./khronos/vulkan/vulkan.h:52:10: fatal error: xcb/xcb.h: No such file or directory
   52 | #include <xcb/xcb.h>
      |          ^~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/SDL2-static.dir/build.make:384: CMakeFiles/SDL2-static.dir/src/events/SDL_events.c.o] Error 1
make[2]: Leaving directory '/home//.xmake/cache/packages/2410/l/libsdl/2.30.7/source/build_ff9476b3'
make[1]: *** [CMakeFiles/Makefile2:139: CMakeFiles/SDL2-static.dir/all] Error 2
make[1]: Leaving directory '/home//.xmake/cache/packages/2410/l/libsdl/2.30.7/source/build_ff9476b3'
make: *** [Makefile:136: all] Error 2