# Build allyourcodebase/SDL on linux

**URL:** <https://ziggit.dev/t/build-allyourcodebase-sdl-on-linux/6857>\
**Category:** Help\
**Tags:** build-system\
**Created:** [November 13, 2024, 9:10pm UTC](https://ziggit.dev/t/build-allyourcodebase-sdl-on-linux/6857 "2024-11-13T21:10:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikastiv](https://ziggit.dev/user_avatar/ziggit.dev/mikastiv/32/3711_2.png) [@mikastiv](https://ziggit.dev/u/mikastiv)\
**Post date:** [November 13, 2024, 9:10pm UTC](https://ziggit.dev/t/build-allyourcodebase-sdl-on-linux/6857/1 "2024-11-13T21:10:59Z")

</div>

When using [GitHub - allyourcodebase/SDL: SDL with the build system replaced by Zig](https://github.com/allyourcodebase/SDL) on linux in my build, I get a whole lot of errors like this:  
`... SDL_config.h.cmake: 540 unable to substitute variable: error: MissingValue`  
Anyone knows how can I fix this? What am I missing?

---

<div class="post-metadata">

**Author:** ![david\_vanderson](https://ziggit.dev/letter_avatar_proxy/v4/letter/d/d2c977/32.png) [@david\_vanderson](https://ziggit.dev/u/david_vanderson)\
**Post date:** [November 18, 2024, 5:25pm UTC](https://ziggit.dev/t/build-allyourcodebase-sdl-on-linux/6857/2 "2024-11-18T17:25:28Z")

</div>

I’m unable to reproduce this on Linux Mint 21.3 - can you say more about what your system/distribution looks like?

---

<div class="post-metadata">

**Author:** ![andrewrk](https://ziggit.dev/user_avatar/ziggit.dev/andrewrk/32/7011_2.png) [@andrewrk](https://ziggit.dev/u/andrewrk)\
**Post date:** [November 19, 2024, 12:05am UTC](https://ziggit.dev/t/build-allyourcodebase-sdl-on-linux/6857/3 "2024-11-19T00:05:21Z")

</div>

Note that there’s limited value in building it on Linux, since most distros have it packaged, and in fact they have it packaged with the ideal backends for that distro. Even if you compile SDL statically on Linux, you will then have to dynamically link x11 or wayland and opengl or vulkan. By depending on system SDL, you let the distro figure that stuff out for you.

I’m not _happy_ with this being the status quo - I would love to be able to distribute [statically linked applications that use the graphics driver](https://www.youtube.com/watch?v=pq1XqP4-qOo). But here we are. My suggestion is to link system SDL when targeting Linux.

---

<div class="post-metadata">

**Author:** ![mikastiv](https://ziggit.dev/user_avatar/ziggit.dev/mikastiv/32/3711_2.png) [@mikastiv](https://ziggit.dev/u/mikastiv)\
**Post date:** [November 19, 2024, 2:57pm UTC](https://ziggit.dev/t/build-allyourcodebase-sdl-on-linux/6857/4 "2024-11-19T14:57:13Z")

</div>

I’m using NixOS 24.05. I achieved a build by adding every missing CMake variables for the config header into SDL’s build.zig. That’s also why I’m suprised that you could build without any modifications to the build script

---

<div class="post-metadata">

**Author:** ![mikastiv](https://ziggit.dev/user_avatar/ziggit.dev/mikastiv/32/3711_2.png) [@mikastiv](https://ziggit.dev/u/mikastiv)\
**Post date:** [November 19, 2024, 3:02pm UTC](https://ziggit.dev/t/build-allyourcodebase-sdl-on-linux/6857/5 "2024-11-19T15:02:38Z")

</div>

I am definitely going to do this from now on. I replaced cmake with zig build for the new SDL3 to see how it would go and Linux was a hassle compared to Windows.

Thank you for your answer!
