• Jobs
  • About Us
  • Jobs
    • Home
    • Jobs
    • Courses and challenges
  • Businesses
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

425
Views
Installing SDL2 on Linux

I try to run simple test.cpp from Twinklebar SDL tutorial, I get this error:

test.cpp:2:10: fatal error: 'SDL2/SDL.h' file not found

So I look up the sdl development package in Ubuntu/Mint:

aptitude search sdl | grep 2

All I can find is this:

libsdl1.2-dev

Does this mean my only option is to install from sources?

over 3 years ago · Santiago Trujillo
1 answers
Answer question

0

It depends which Ubuntu version you are running but yes, there is a libsdl2 package for Ubuntu: http://packages.ubuntu.com/search?keywords=sdl2

The package you want is called libsdl2-dev.

Also, about the #include <SDL/SDL.h> line, it seems the recommended way doing it is by adjusting your compiler flags to add SDL's include pah and use #include "SDL.h". See https://forums.libsdl.org/viewtopic.php?t=5997 for more details on that.

over 3 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Show me some job opportunities
There's an error!