Skip to main content
Pacman is built with C and SDL 1.2, requiring several system libraries for graphics, audio, and display management.

Required libraries

libsdl1.2-dev
package
required
SDL 1.2 (Simple DirectMedia Layer)Core multimedia library providing low-level access to audio, keyboard, mouse, and graphics hardware.Used for:
  • Window and surface management
  • Event handling (keyboard input)
  • Video mode control
  • Double buffering and palette management
Headers: SDL.hLinker flag: -lSDL
libsdl-image1.2-dev
package
required
SDL_image 1.2Image loading library for SDL that supports multiple formats including BMP, GIF, and PNG.Used for:
  • Loading sprite graphics (.bmp, .gif)
  • Loading game board textures
  • Loading font bitmaps
Linker flag: -lSDL_image
libmikmod-dev
package
required
libmikmodSound and music library for playing various audio formats.Used for:
  • Background music playback
  • Sound effects (eating pellets, ghost sounds, sirens)
  • Game audio mixing
Audio files: .wav files in data/ directoryLinker flag: -lmikmod
libglfw3-dev
package
required
GLFW 3Multi-platform library for OpenGL, providing access to monitor and display information.Used for:
  • Detecting primary monitor resolution
  • Querying video mode and refresh rate
  • Resolution information for restoration script
Headers: GLFW/glfw3.hLinker flag: -lglfw
GLFW is only used for display detection, not for rendering. SDL 1.2 handles all graphics.
x11-utils
package
required
X11 utilities (includes xrandr)X Window System utilities for display configuration management.Used for:
  • Saving multi-monitor layout
  • Generating resolution restoration scripts
  • Restoring display configuration on exit
Binary: /usr/bin/xrandr
The game will run without xrandr, but resolution restoration will not work. A warning is displayed at startup if not found.

System libraries

These standard C libraries are also required:
  • libm - Math library (-lm)
  • libc - Standard C library (implicit)

Installation

sudo apt install libsdl1.2-dev libsdl-image1.2-dev libglfw3-dev libmikmod-dev x11-utils
sudo dnf install SDL-devel SDL_image-devel glfw-devel libmikmod-devel xorg-x11-utils
sudo pacman -S sdl sdl_image glfw-x11 libmikmod xorg-xrandr
sudo zypper install libSDL-devel libSDL_image-devel glfw-devel libmikmod-devel xrandr

Version requirements

The project was developed and tested on Debian Testing with the following library versions:
LibraryVersionNotes
SDL1.2.xMust be SDL 1.2, not SDL 2.0
SDL_image1.2.xCompatible with SDL 1.2
GLFW3.xVersion 3 or higher
libmikmod3.xAny recent version
xrandr-Included in x11-utils
This project is not compatible with SDL 2.0. You must use SDL 1.2.x. The API and initialization functions are different between major versions.

Build configuration

Dependencies are configured in the Makefile:
INCLUDEDIR = /usr/include/SDL
LDFLAGS = -L/usr/lib -lSDL -lSDL_image -lm -lmikmod -lglfw

Compiler flags

The project uses these compiler optimizations:
CFLAGS = -DLINUX -O3 -ggdb -ffast-math -funroll-loops \
         -fomit-frame-pointer -Wall -pipe

Verifying installation

To verify all dependencies are installed:
pkg-config --modversion sdl

Runtime dependencies

In addition to compile-time libraries, the game requires:

Data files

  • Sprites: data/sprites.bmp, data/sprites.gif
  • Fonts: data/fonts.bmp, data/fonts.gif
  • Backgrounds: data/tablero.bmp, data/portada.bmp
  • Audio files: Various .wav files in data/

System requirements

  • X11 display server - Required for graphical output
  • Linux kernel - Developed for Linux (x86-64 or i386)
  • Bash shell - For running restoration scripts

Troubleshooting

If you get compilation errors about missing SDL headers:
  1. Verify SDL 1.2 development files are installed:
    dpkg -l | grep libsdl1.2-dev
    
  2. Check header location:
    ls /usr/include/SDL/SDL.h
    
  3. Update INCLUDEDIR in Makefile if headers are in a different location
If you get undefined reference errors during linking:
  1. Verify libraries are installed:
    ldconfig -p | grep -E '(SDL|mikmod|glfw)'
    
  2. Check library paths:
    pkg-config --libs sdl SDL_image
    
  3. Ensure all required libraries are in LDFLAGS
If you see the warning about xrandr not being available:
  1. Install x11-utils:
    sudo apt install x11-utils
    
  2. Verify installation:
    xrandr --version
    
The game will still run, but resolution restoration won’t work.

See also

Build docs developers (and LLMs) love