分享

Nothing to Code: Setting up SDL2 in Ubuntu Linux Mint Debian

 好美的红蔷薇 2016-05-26
Updated: November 2014

In this tutorial you're going to install SDL2 from your repositories and finally run a test. This is the easiest way. You only have to search and install the packages using the package manager. Obviously, you will not have the latest version and fixes, but it's enough if you're starting with SDL2. If you need to install the latest version compiling the source code or you have any problem with this tutorial, go to this forum: http://www.

Install the following packages using apt, apt-get or aptitude

build-essential
libsdl2-dev
libsdl2-gfx-dev
libsdl2-image-dev
libsdl2-mixer-dev
libsdl2-net-dev
libsdl2-ttf-dev

Testing SDL2

Now you're a going to test SDL2 with a simple code
Go to your user home directory, you can use cd or cd ~

cd ~

Create a new directory for your SDL2 projects and one for this test

mkdir -p SDL2projects/SDL2test

Go to SDL2test directory

cd SDL2projects/SDL2test

Download the following image and the source code file

wget http:///files/0002/sdl.bmp
wget http:///files/0002/main.c

Compile the file main.c with the command

gcc main.c -o test -Wall -lSDL2

Run the program

./test

Enjoy it  

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多