找不到'SDL2 / SDL_image.h'文件

时间:2019-08-21 22:45:30

标签: c++ macos sdl-2 sdl-image

我正在Xcode上编程。我包括SDL_image.h作为 #include <SDL2/SDL_image.h>

它说找不到“ SDL2 / SDL_image.h”文件

我已经安装了SDL2.framework和SDL2_image.framework库并将其与二进制文件链接。

我使用Makefile进行编译,但出现错误:致命错误:找不到'SDL2 / SDL_image.h'文件

这是我的Makefile

# set the compiler
CC := clang

# set the compiler flags
CXXFLAGS = -std=c++14 -Wall -MMD -Werror=vla pkg-config --cflags --libs sdl2 `-L/Library/Frameworks/ sdl2-config --libs --cflags` -ggdb3 -O0 --std=c99 -Wall -l SDL2_image -lm

# add source files here
SRCS := main.cpp #file-name.c

# generate names of object files
OBJS := $(SRCS:.c=.o)

# name of executable
EXEC := sdl #name your executable file

# default recipe
all: $(EXEC)

showfont: showfont.c Makefile
    $(CC) -o $@ $@.c $(CFLAGS) $(LIBS)

glfont: glfont.c Makefile
    $(CC) -o $@ $@.c $(CFLAGS) $(LIBS)

# recipe for building the final executable
$(EXEC): $(OBJS) $(HDRS) Makefile
    $(CC) -o $@ $(OBJS) $(CFLAGS)

# recipe for building object files
#$(OBJS): $(@:.o=.c) $(HDRS) Makefile
#    $(CC) -o $@ $(@:.o=.c) -c $(CFLAGS)

# recipe to clean the workspace
clean:
    rm -f $(EXEC) $(OBJS)

.PHONY: all clean

0 个答案:

没有答案