Common issues and solutions
This guide covers frequent problems encountered when building and running the Pacman game, along with their solutions.Compilation errors
SDL library not found
SDL library not found
Error message:Solution:Install the SDL development libraries:
Make sure you install
libsdl1.2-dev, not libsdl2-dev. This project requires SDL 1.2 specifically.GLFW library not found
GLFW library not found
Error message:Solution:Install GLFW3 development library:GLFW is used for resolution detection in
main.c:24-54.Linking errors with -lmikmod
Linking errors with -lmikmod
Error message:Solution:Install the mikmod library:This library is required for audio support.
Undefined reference to math functions
Undefined reference to math functions
Error message:Solution:Ensure the Makefile includes If the problem persists, clean and rebuild:
-lm in LDFLAGS (it should already be there):Implicit function declaration warnings
Implicit function declaration warnings
Warning message:Solution:While these are warnings (not errors), they should be fixed by ensuring proper includes:These includes should already be in the source files.
Runtime errors
Couldn't initialize SDL error
Couldn't initialize SDL error
Error message:Solution:This typically occurs when running without X11/Wayland display:
- Ensure you’re in a graphical environment (not SSH without X forwarding)
- Check DISPLAY environment variable:
- If using SSH, enable X forwarding:
- On Wayland, install SDL X11 compatibility:
Video mode initialization failed
Video mode initialization failed
Error message:Solution:The game requires 320x200 resolution support:
-
Try windowed mode instead of fullscreen:
- Check your display supports 32-bit color depth
- Update graphics drivers if using older hardware
Windowed mode (
-w) is more compatible across different systems than fullscreen (-f).Segmentation fault on startup
Segmentation fault on startup
Error message:Potential causes and solutions:
- Missing game assets
- Check that the
data/directory exists and contains required files:
- Check that the
- Corrupted sprite files
- The game loads sprites from
data/sprites.bmpat startup - Verify file integrity and format (should be BMP)
- The game loads sprites from
- Memory allocation issues
- Run with debugging:
- Run with debugging:
xrandr and resolution issues
xrandr not available warning
xrandr not available warning
Warning message:Solution:Install xrandr (part of x11-utils):Verify installation:
Resolution not restored after exit
Resolution not restored after exit
Problem:
After closing the game in fullscreen mode, your desktop resolution remains changed.Solution:
-
Manually run the restoration script:
-
Check if script was created:
-
Manually restore resolution:
The restoration script is generated at
src/main.c:56-111 during game startup. If the game crashes, this script can be manually executed.Multi-monitor configuration lost
Multi-monitor configuration lost
Problem:
After running in fullscreen, your multi-monitor setup (extended displays, positions) is incorrect.Solution:
-
Check the restoration script contents:
It should contain commands with
--posand--primaryflags. -
Execute the script:
-
Manual restoration (example for dual monitors):
Wayland session - xrandr unavailable
Wayland session - xrandr unavailable
Audio issues
No sound or audio errors
No sound or audio errors
Problem:
No audio plays during gameplay.Solution:
-
Check if sound file exists:
The presence of this file enables audio.
-
Verify audio system:
-
Install audio dependencies:
-
Check mixer settings:
Audio implementation may be incomplete or commented out in current version. Check
misc.c for playon variable usage.Performance issues
Game running too fast or too slow
Game running too fast or too slow
Problem:
Gameplay speed is inconsistent or incorrect.Solution:The game uses a timer-based frame limiter at
gfx.c:108:-
Check CPU usage:
- Verify FRAMES_PER_SEC definition in gfx.h
-
Timer signal issues:
The game uses
SIGALRMwithsetitimerat 18.2 Hz (seegfx.c:155-178)
High CPU usage
High CPU usage
Problem:
Game consumes excessive CPU resources.Solution:
- Normal behavior: SDL 1.2 without hardware acceleration can use significant CPU
-
Try hardware acceleration:
Set SDL to use hardware surface:
-
Monitor with:
misc.c:538-912), which is typical for SDL 1.2 games.Still having issues?
If none of these solutions work:This project was developed on Debian Testing. Most issues occur from missing dependencies or unsupported display configurations.