p;<< input << " you need to enter m to exit." << endl; } exit(0); }
- 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里的行首缩进用的是Tab而不是空格。如果编译时提示 No separator...就是这里有问题。
9. Ok, 选中工程,点Build(或点那个小锤子),你会发现这个错误:(Cannot run program "make": Launching failed),啊,我们的make.exe还没设。选中工程,直接Alt-Enter到工程属性页,把msys的bin加到Path里。
10. 重新build, 大功告成。 |