为了实现本教程的目的,我们已指示您创建了一个“标准 Make C++”项目,该项目要求您创建一个 makefile。“受管 Make C/C++”项目会为您生成 makefile。
要创建 makefile:
all: hello.exe
clean:
rm main.o hello.exe
hello.exe: main.o
g++ -g -o hello main.o
main.o:
g++ -c -g main.cpp
新的 makefile 以及 main.cpp 文件将显示在“C/C++ 项目”视图和“导航器”视图中。项目现在包含 main.cpp 和 makefile。现在,您可以构建 HelloWorld 项目了。