在Fedora 20上如何安装SDL2库

5
在StackOverflow中有一个关于Fedora中SDL软件包(SDL 1.2)的问题。但是我没有在Fedora中找到有关SDL2的任何信息,并且我在安装SDL2软件包时遇到了麻烦。
我搜索了一下,发现在Fedora中安装SDL2的命令是:

sudo yum install SDL2*

但仍然无法找到#include "SDL2/SDL.h".
在查看usr/include/后,我没有找到SDL.h……
那么,在Fedora 20版本中,如何安装SDL2软件包并使其正常工作?
2个回答

8

4
  1. Make Sure to have SDL2 and development headers installed correctly.

    $ yum search SDL2 #look for libraries and development headers should something like sdl2.0 and sdl2.0.0-dev
    
  2. include SDL2 in sourcefile for example main.c

    #include "SDL2/SDL.h"
    
  3. and make sure to link SDL2 library with the compiler flag -lSDL2

    $ clang main.c -lSDL2 -o programName
    

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接