My MakeFile can't find my header directory

前端 未结 1 603
隐瞒了意图╮
隐瞒了意图╮ 2021-01-27 15:21

This is my Makefile :

NAME    = pong

SRCS    = src/main.cpp

OBJS    = $(SRCS:.cpp=.o)

CFLAGS  += -lsfml-graphics -lsfml-window -lsfml-system -I include/

all         


        
相关标签:
1条回答
  • 2021-01-27 16:01

    With your rule

    $(NAME): $(OBJS)
    

    the dependency on $(OBJS) will run makes implicit ℅.o : ℅.cpp rule first, which in turn uses $CXXFLAGS and thus doesn't see the -I option.

    As your rule is written, just omit the dependency on $(OBJS).

    0 讨论(0)
提交回复
热议问题