简体   繁体   中英

I have installed SDL but it still doesn't seem to work

I am on a 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

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

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

-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 . Either remove "SDL2" from your #include statement or your -I switch.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM