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

Can't run SDL programs #5393

Open
vsian opened this issue Oct 1, 2024 · 0 comments
Open

Can't run SDL programs #5393

vsian opened this issue Oct 1, 2024 · 0 comments
Labels

Comments

@vsian
Copy link

vsian commented Oct 1, 2024

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
@vsian vsian added the bug label Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant