Before going any further, we need to install the SDL library.
Depending on your package management tool, run the following to install SDL2 on Linux:
apt package mananger
:
$ sudo apt-get install libsdl2-dev
dnf package manager
:
$ sudo dnf install SDL2-devel
yum package manager
:
$ yum install SDL2-devel
Once done, your SDL2 installation is ready!
To install SDL2 on Mac, Simply run the following:
$ brew install sdl2
All these installation instructions come directly from the Rust SDL2 crate.
A few steps will be required in order to make all of it work. Follow the guide!
- Download the
mingw
andmsvc
development libraries from http://www.libsdl.org/ (SDL2-devel-2.0.x-mingw.tar.gz
andSDL2-devel-2.0.x-VC.zip
). - Unpack to folders of your choice. (You can delete it afterward.)
- Create the following folder structure in the same folder as your
Cargo.toml
:
gnu-mingw\dll\32 ...