[英]I have installed SDL but it still doesn't seem to work
I am on a mac. 我在Mac上。 So I've looked everywhere what i first did was download the SDL file from https://hg.libsdl.org/SDL
After that i followed the instructions on https://wiki.libsdl.org/Installation
and wrote the following on my terminal 因此,我到处都看过我最初要做的是从https://hg.libsdl.org/SDL
下载SDL文件。之后,我按照https://wiki.libsdl.org/Installation
上的说明进行操作,并在我的终端
mkdir build
cd build
../configure
make
sudo make install
so far so good but after this when i cd to my Desktop and type gcc test.c sdl2-config --cflags --libs
into my terminal it still gives me the error 到目前为止到目前为止还不错,但是在此之后,当我将其CD到我的桌面并键入gcc test.c sdl2-config --cflags --libs
到我的终端时,它仍然给我错误
test.c:2:10: fatal error: 'SDL2/SDL.h' file not found
#include <SDL2/SDL.h>
^
1 error generated.
if i type just sdl2-config --cflags --libs
into my terminal it returns 如果我只在终端中输入sdl2-config --cflags --libs
它将返回
-I/usr/local/include/SDL2 -D_THREAD_SAFE
-L/usr/local/lib -lSDL2
so i think it is successfully installed any idea on what the problem is? 所以我认为它成功安装了关于问题是什么的任何想法? Thanks a lot 非常感谢
Your header is located at /usr/local/include/SDL2/SDL.h
but you're trying to include /usr/local/include/SDL2/SDL2/SDL.h
. 标头位于/usr/local/include/SDL2/SDL.h
但是您尝试包含/usr/local/include/SDL2/SDL2/SDL.h
。 Either remove "SDL2" from your #include
statement or your -I
switch. 从您的#include
语句或-I
开关中删除“ SDL2”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.