編譯過程:
[root@mail c]# g++ -Wall -O2 -c test.o test.cpp
g++: test.o: No such file or directory
請(qǐng)問:為什么會(huì)出現(xiàn)這個(gè)“No such file or directory”呢,我試驗(yàn)過,如果寫makefile的話,編譯多個(gè).o,就會(huì)報(bào)makefile錯(cuò)誤,因?yàn)椴荒苓B續(xù)的把.o文件編譯出來,每次都會(huì)報(bào)這個(gè)錯(cuò)誤,但是還能把.o編譯出來,很奇怪?