Akhmad Zaki
Akhmad Zaki

Reputation: 433

Installing SDL2 Development version on Ubuntu Linux

I am trying to install SDL2 on Linux Ubuntu 18.04. However there are 2 types of packages available on the repository, the 'normal' library version and the development files version.

libsdl2-2.0-0/bionic-updates,bionic-security 2.0.8+dfsg1-1ubuntu1.18.04.4 amd64
  Simple DirectMedia Layer

libsdl2-dev/bionic-updates,bionic-security 2.0.8+dfsg1-1ubuntu1.18.04.4 amd64
  Simple DirectMedia Layer development files

What I am asking is are there differences between the two version for developing application/game using SDL2 and which one should I install if I am just starting to learn SDL2?

Upvotes: 3

Views: 3609

Answers (2)

astrosnapper
astrosnapper

Reputation: 351

Ubuntu (and other Linux distributions) often divide up packages this way: the first package contains libraries and executables needed to run something compiled with the package (SDL2 in this case), the dev packages contains the headers, additional libraries or config files needed to compile a program with package. You want to install both; normally installing the dev version of the package will pull in the other as a dependency.

Upvotes: 3

Jochen Reinhardt
Jochen Reinhardt

Reputation: 843

You will need both, most likely :)

The lib package contains the binary SDL library. That's needed to run a program.

But in order to develop an application, you need the C header files to include in your source code - assuming that you want to create a program in C or C++. The compiler needs these files to 'see' the functions provided by the lib.

If you want to use SDL library in a different way, you could also use python and python-pygame-sdl2.

Upvotes: 0

Related Questions