我正在尝试将SDL库包含在我的c ++项目中。我已经安装了SDL2.framework并将其包含在Library / Frameworks中。我还在终端中运行了以下命令:
brew install SDL2
brew install SDL2_Image
但是,当我尝试使用makefile进行编译时:
OBJS=texture.cpp window.cpp
LFLAGS=-lSDL2 -lSDL2_image
CURRDIR=`pwd`
.PHONY: test
all: test
test: $(OBJS) test.o
g++ -std=c++11 -Wall $(OBJS) test.o $(LFLAGS)
test.o: test.cpp
g++ -c -std=c++11 -DSPRITEFILENAME="\"$(CURRDIR)/sprites.png\"" -Wall test.cpp -o test.o
我收到以下错误:
./texture.h:7:10: fatal error: 'SDL2/SDL.h' file not found
#include <SDL2/SDL.h>
^
1 error generated.
make: *** [test.o] Error 1
任何帮助将不胜感激。