sdl-config(1)
β¨ sdl-config β bestie edition β¨
okay so you know that one little script that tells you literally everything about your installed SDL? yeah. that's this. it's a General Commands Manual page, and it lives at sdl-config(1), so you can pull it up whenever with man 1 sdl-config. π«Ά
πΈ NAME πΈ
sdl-config β it's a script, and its whole job is handing you the tea about the installed version of SDL π
π¦ SYNOPSIS π¦
sdl-config [--prefix=[DIR]] [--exec-prefix=[DIR]] [--version] [--cflags]
[--libs] [--static-libs]
that's the whole vibe check right there β¨
π DESCRIPTION π
so sdl-config is the tool you use to configure stuff and figure out the compiler and linker flags you should be using to compile and link programs, libraries, and plugins that use SDL. no cap.
it's also used internally by the m4 macros that ship with SDL, so it's lowkey the backbone of the whole operation. iconic behavior honestly π
π OPTIONS π
--cflagsβ prints the compiler flags you need to compile a program or library that uses SDL. your gcc's new best friend fr fr.--exec-prefix[=DIR]β okay so, ifDIRis not specified, it prints the exec prefix of the current SDL installation.
if DIR is specified, it uses that instead of the installation exec prefix that SDL was built with when it computes the output for the --cflags, --libs and --static-libs options.
β οΈ bestie listen β this option MUST be specified before any of--cflags,--libsand--static-libs. order matters, okay? π
--libsβ prints the linker flags you need to link a program that uses SDL. chef's kiss π--static-libsβ prints the linker flags you need to statically link a program that uses SDL. different energy, same icon status.--prefix[=DIR]β ifDIRis not specified, it prints the prefix of the current SDL installation.
if DIR is specified, it uses that instead of the installation prefix that SDL was built with when computing the output for the --cflags, --libs and --static-libs options. it's also used for the exec prefix if --exec-prefix was not specified.
β οΈ again, and I cannot stress this enough β this option MUST come before any of--cflags,--libsand--static-libs. periodt. π
--versionβ prints the currently installed version of SDL on standard output. short, sweet, slay.
π EXAMPLES π
- compile a C source file into an executable program, like so:
gcc -o main.o $(sdl-config --cflags) main.c
- link compiled objects into an executable program, like so:
gcc -o my_app $(sdl-config --libs) main.o util.o
see? the command substitution is doing the heavy lifting and we are just vibing π§
π AUTHOR π
the Simple DirectMedia Layer (SDL) library was written by Sam Lantinga. π«Ά
this manual page was written by Branden Robinson, originally for Progeny Linux Systems, Inc., and the Debian Project. Updated in 2013 by Manuel A. Fernandez Montecelo <mafm@debian.org>.
and that's the whole page bestie π this was SDL 1.2, dated 2013-07-27 β go forth and link things, you're gonna eat π₯π
π¦ where this page comes from
- debian bookworm: libsdl1.2-dev 1.2.15+dfsg2-8 Β· LGPL-2.1-or-later
- ubuntu jammy: libsdl1.2-dev 1.2.15+dfsg2-6 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms