Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的 Makefile 包含以下内容:
CC= g++ LIBS= -lSDL clean: rm -f a
它只是不会编译,因为 g++ 不采用 -lSDL 参数,即使我包含了它。
不过,当我g++ a.cpp -o a -lSDL 直接在终端中编译时,它编译得很好。
g++ a.cpp -o a -lSDL
添加规则:
a: a.cpp $(CC) $< -o $@ $(LIBS)