我还有一个问题,即netbeans没有创建.exe但netbeans没有错误输出。这仍然没有得到解决。因为我被要求在没有IDE的情况下编译这个项目,但只使用'make'而我之前从未这样做过,所以我创建了这个简单的程序以便了解makefile。
//main.cpp
int main() {
int i = 1;
return 0;
}
我的makefile如下所示:
project000: main.o
g++ -Wall main.o -o project000
main.o: main.cpp
g++ -Wall -c main.cpp
clean:
rm *.o project000
当我进入项目目录并执行'make'时,会创建.o文件,我可以看到project000.exe正在创建然后被删除!所以我检查了makefile的'clean'部分是否每次都通过缩短makefile来执行
project000: main.o
g++ -Wall main.o -o project000
main.o: main.cpp
g++ -Wall -c main.cpp
但同样的事情发生了。正在创建.exe然后删除.exe。
任何人?
'make -d'的输出(可能不包括开头,因为我运行时我的提示线太少了)
Trying implicit prerequisite `Makefile.l'.
Looking for a rule with intermediate file `Make
Avoiding implicit rule recursion.
Avoiding implicit rule recursion.
Avoiding implicit rule recursion.
Trying pattern rule with stem `Makefile.l'.
Trying implicit prerequisite `Makefile.l,v'.
Trying pattern rule with stem `Makefile.l'.
Trying implicit prerequisite `RCS/Makefile.l,v
Trying pattern rule with stem `Makefile.l'.
Trying implicit prerequisite `RCS/Makefile.l'.
Trying pattern rule with stem `Makefile.l'.
Trying implicit prerequisite `s.Makefile.l'.
Trying pattern rule with stem `Makefile.l'.
Trying implicit prerequisite `SCCS/s.Makefile.
Trying pattern rule with stem `Makefile'.
Trying implicit prerequisite `Makefile.w'.
Looking for a rule with intermediate file `Make
Avoiding implicit rule recursion.
Avoiding implicit rule recursion.
Avoiding implicit rule recursion.
Trying pattern rule with stem `Makefile.w'.
Trying implicit prerequisite `Makefile.w,v'.
Trying pattern rule with stem `Makefile.w'.
Trying implicit prerequisite `RCS/Makefile.w,v
Trying pattern rule with stem `Makefile.w'.
Trying implicit prerequisite `RCS/Makefile.w'.
Trying pattern rule with stem `Makefile.w'.
Trying implicit prerequisite `s.Makefile.w'.
Trying pattern rule with stem `Makefile.w'.
Trying implicit prerequisite `SCCS/s.Makefile.
Trying pattern rule with stem `Makefile'.
Rejecting impossible implicit prerequisite `Mak
Trying pattern rule with stem `Makefile'.
Trying implicit prerequisite `Makefile.cc'.
Looking for a rule with intermediate file `Makef
Avoiding implicit rule recursion.
Avoiding implicit rule recursion.
Trying pattern rule with stem `Makefile.cc'.
Trying implicit prerequisite `Makefile.cc,v'.
Trying pattern rule with stem `Makefile.cc'.
Trying implicit prerequisite `RCS/Makefile.cc,v
Trying pattern rule with stem `Makefile.cc'.
Trying implicit prerequisite `RCS/Makefile.cc'.
Trying pattern rule with stem `Makefile.cc'.
Trying implicit prerequisite `s.Makefile.cc'.
Trying pattern rule with stem `Makefile.cc'.
Trying implicit prerequisite `SCCS/s.Makefile.c
Trying pattern rule with stem `Makefile'.
Trying implicit prerequisite `Makefile.C'.
Looking for a rule with intermediate file `Makef
Avoiding implicit rule recursion.
Avoiding implicit rule recursion.
Trying pattern rule with stem `Makefile.C'.
Trying implicit prerequisite `Makefile.C,v'.
Trying pattern rule with stem `Makefile.C'.
Trying implicit prerequisite `RCS/Makefile.C,v'
Trying pattern rule with stem `Makefile.C'.
Trying implicit prerequisite `RCS/Makefile.C'.
Trying pattern rule with stem `Makefile.C'.
Trying implicit prerequisite `s.Makefile.C'.
Trying pattern rule with stem `Makefile.C'.
Trying implicit prerequisite `SCCS/s.Makefile.C
Trying pattern rule with stem `Makefile'.
Trying implicit prerequisite `Makefile.cpp'.
Looking for a rule with intermediate file `Makef
Avoiding implicit rule recursion.
Avoiding implicit rule recursion.
Trying pattern rule with stem `Makefile.cpp'.
Trying implicit prerequisite `Makefile.cpp,v'.
Trying pattern rule with stem `Makefile.cpp'.
Trying implicit prerequisite `RCS/Makefile.cpp,
Trying pattern rule with stem `Makefile.cpp'.
Trying implicit prerequisite `RCS/Makefile.cpp'
Trying pattern rule with stem `Makefile.cpp'.
Trying implicit prerequisite `s.Makefile.cpp'.
Trying pattern rule with stem `Makefile.cpp'.
Trying implicit prerequisite `SCCS/s.Makefile.c
Trying pattern rule with stem `Makefile'.
Trying implicit prerequisite `Makefile.p'.
Looking for a rule with intermediate file `Makef
Avoiding implicit rule recursion.
Avoiding implicit rule recursion.
Trying pattern rule with stem `Makefile'.
Trying implicit prerequisite `Makefile.web'.
Trying pattern rule with stem `Makefile.p'.
Trying implicit prerequisite `Makefile.p,v'.
Trying pattern rule with stem `Makefile.p'.
Trying implicit prerequisite `RCS/Makefile.p,v'
Trying pattern rule with stem `Makefile.p'.
Trying implicit prerequisite `RCS/Makefile.p'.
Trying pattern rule with stem `Makefile.p'.
Trying implicit prerequisite `s.Makefile.p'.
Trying pattern rule with stem `Makefile.p'.
Trying implicit prerequisite `SCCS/s.Makefile.p
Trying pattern rule with stem `Makefile'.
Trying implicit prerequisite `Makefile.web'.
Looking for a rule with intermediate file `Make
Avoiding implicit rule recursion.
Avoiding implicit rule recursion.
Avoiding implicit rule recursion.
Trying pattern rule with stem `Makefile.web'.
Trying implicit prerequisite `Makefile.web,v'.
Trying pattern rule with stem `Makefile.web'.
Trying implicit prerequisite `RCS/Makefile.web
Trying pattern rule with stem `Makefile.web'.
Trying implicit prerequisite `RCS/Makefile.web
Trying pattern rule with stem `Makefile.web'.
Trying implicit prerequisite `s.Makefile.web'.
Trying pattern rule with stem `Makefile.web'.
Trying implicit prerequisite `SCCS/s.Makefile.
Trying pattern rule with stem `Makefile'.
Trying implicit prerequisite `Makefile.f'.
Looking for a rule with intermediate file `Makef
Avoiding implicit rule recursion.
Avoiding implicit rule recursion.
Trying pattern rule with stem `Makefile'.
Trying implicit prerequisite `Makefile.F'.
Trying pattern rule with stem `Makefile'.
Trying implicit prerequisite `Makefile.r'.
Trying pattern rule with stem `Makefile.f'.
Trying implicit prerequisite `Makefile.f,v'.
Trying pattern rule with stem `Makefile.f'.
Trying implicit prerequisite `RCS/Makefile.f,v'
Trying pattern rule with stem `Makefile.f'.
Trying implicit prerequisite `RCS/Makefile.f'.
Trying pattern rule with stem `Makefile.f'.
Trying implicit prerequisite `s.Makefile.f'.
Trying pattern rule with stem `Makefile.f'.
Trying implicit prerequisite `SCCS/s.Makefile.f
Trying pattern rule with stem `Makefile'.
Trying implicit prerequisite `Makefile.F'.
Looking for a rule with intermediate file `Make
Avoiding implicit rule recursion.
Avoiding implicit rule recursion.
Avoiding implicit rule recursion.
Trying pattern rule with stem `Makefile.F'.
Trying implicit prerequisite `Makefile.F,v'.
Trying pattern rule with stem `Makefile.F'.
Trying implicit prerequisite `RCS/Makefile.F,v
Trying pattern rule with stem `Makefile.F'.
Trying implicit prerequisite `RCS/Makefile.F'.
Trying pattern rule with stem `Makefile.F'.
Trying implicit prerequisite `s.Makefile.F'.
Trying pattern rule with stem `Makefile.F'.
Trying implicit prerequisite `SCCS/s.Makefile.
Trying pattern rule with stem `Makefile'.
Trying implicit prerequisite `Makefile.r'.
Looking for a rule with intermediate file `Make
Avoiding implicit rule recursion.
Avoiding implicit rule recursion.
Avoiding implicit rule recursion.
Trying pattern rule with stem `Makefile'.
Rejecting impossible implicit prerequisite `Ma
Trying pattern rule with stem `Makefile.r'.
Trying implicit prerequisite `Makefile.r,v'.
Trying pattern rule with stem `Makefile.r'.
Trying implicit prerequisite `RCS/Makefile.r,v
Trying pattern rule with stem `Makefile.r'.
Trying implicit prerequisite `RCS/Makefile.r'.
Trying pattern rule with stem `Makefile.r'.
Trying implicit prerequisite `s.Makefile.r'.
Trying pattern rule with stem `Makefile.r'.
Trying implicit prerequisite `SCCS/s.Makefile.
Trying pattern rule with stem `Makefile'.
Rejecting impossible implicit prerequisite `Make
Trying pattern rule with stem `Makefile'.
Rejecting impossible implicit prerequisite `Make
Trying pattern rule with stem `Makefile'.
Trying implicit prerequisite `Makefile.s'.
Looking for a rule with intermediate file `Makef
Avoiding implicit rule recursion.
Avoiding implicit rule recursion.
Trying pattern rule with stem `Makefile'.
Trying implicit prerequisite `Makefile.S'.
Trying pattern rule with stem `Makefile.s'.
Trying implicit prerequisite `Makefile.s,v'.
Trying pattern rule with stem `Makefile.s'.
Trying implicit prerequisite `RCS/Makefile.s,v'
Trying pattern rule with stem `Makefile.s'.
Trying implicit prerequisite `RCS/Makefile.s'.
Trying pattern rule with stem `Makefile.s'.
Trying implicit prerequisite `s.Makefile.s'.
Trying pattern rule with stem `Makefile.s'.
Trying implicit prerequisite `SCCS/s.Makefile.s
Trying pattern rule with stem `Makefile'.
Trying implicit prerequisite `Makefile.S'.
Looking for a rule with intermediate file `Make
Avoiding implicit rule recursion.
Avoiding implicit rule recursion.
Avoiding implicit rule recursion.
Trying pattern rule with stem `Makefile.S'.
Trying implicit prerequisite `Makefile.S,v'.
Trying pattern rule with stem `Makefile.S'.
Trying implicit prerequisite `RCS/Makefile.S,v
Trying pattern rule with stem `Makefile.S'.
Trying implicit prerequisite `RCS/Makefile.S'.
Trying pattern rule with stem `Makefile.S'.
Trying implicit prerequisite `s.Makefile.S'.
Trying pattern rule with stem `Makefile.S'.
Trying implicit prerequisite `SCCS/s.Makefile.
Trying pattern rule with stem `Makefile'.
Rejecting impossible implicit prerequisite `Make
Trying pattern rule with stem `Makefile'.
Trying implicit prerequisite `Makefile.mod'.
Looking for a rule with intermediate file `Makef
Avoiding implicit rule recursion.
Avoiding implicit rule recursion.
Trying pattern rule with stem `Makefile.mod'.
Trying implicit prerequisite `Makefile.mod,v'.
Trying pattern rule with stem `Makefile.mod'.
Trying implicit prerequisite `RCS/Makefile.mod,
Trying pattern rule with stem `Makefile.mod'.
Trying implicit prerequisite `RCS/Makefile.mod'
Trying pattern rule with stem `Makefile.mod'.
Trying implicit prerequisite `s.Makefile.mod'.
Trying pattern rule with stem `Makefile.mod'.
Trying implicit prerequisite `SCCS/s.Makefile.m
Trying pattern rule with stem `Makefile'.
Rejecting impossible implicit prerequisite `Makef
Trying pattern rule with stem `Makefile'.
Rejecting impossible implicit prerequisite `Makef
Trying pattern rule with stem `Makefile'.
Rejecting impossible implicit prerequisite `Makef
Trying pattern rule with stem `Makefile'.
Rejecting impossible implicit prerequisite `Makef
Trying pattern rule with stem `Makefile'.
Rejecting impossible implicit prerequisite `Makef
Trying pattern rule with stem `Makefile'.
Rejecting impossible implicit prerequisite `Makef
Trying pattern rule with stem `Makefile'.
Rejecting impossible implicit prerequisite `Makef
Trying pattern rule with stem `Makefile'.
Rejecting impossible implicit prerequisite `Makef
Trying pattern rule with stem `Makefile'.
Rejecting impossible implicit prerequisite `Makef
Trying pattern rule with stem `Makefile'.
Rejecting impossible implicit prerequisite `Makef
Trying pattern rule with stem `Makefile'.
Rejecting impossible implicit prerequisite `Makef
Trying pattern rule with stem `Makefile'.
Trying implicit prerequisite `Makefile.sh'.
Looking for a rule with intermediate file `Makefi
Avoiding implicit rule recursion.
Trying pattern rule with stem `Makefile.sh'.
Trying implicit prerequisite `Makefile.sh,v'.
Trying pattern rule with stem `Makefile.sh'.
Trying implicit prerequisite `RCS/Makefile.sh,v'
Trying pattern rule with stem `Makefile.sh'.
Trying implicit prerequisite `RCS/Makefile.sh'.
Trying pattern rule with stem `Makefile.sh'.
Trying implicit prerequisite `s.Makefile.sh'.
Trying pattern rule with stem `Makefile.sh'.
Trying implicit prerequisite `SCCS/s.Makefile.sh
No implicit rule found for `Makefile'.
Finished prerequisites of target file `Makefile'.
No need to remake target `Makefile'.
Updating goal targets....
Considering target file `project000.exe'.
File `project000.exe' does not exist.
Considering target file `main.o'.
Considering target file `main.cpp'.
Looking for an implicit rule for `main.cpp'.
Trying pattern rule with stem `main.cpp'.
Trying implicit prerequisite `main.cpp,v'.
Trying pattern rule with stem `main.cpp'.
Trying implicit prerequisite `RCS/main.cpp,v'.
Trying pattern rule with stem `main.cpp'.
Trying implicit prerequisite `RCS/main.cpp'.
Trying pattern rule with stem `main.cpp'.
Trying implicit prerequisite `s.main.cpp'.
Trying pattern rule with stem `main.cpp'.
Trying implicit prerequisite `SCCS/s.main.cpp'
Looking for a case-insensitive implicit rule f
Trying pattern rule with stem `main.cpp'.
Trying implicit prerequisite `main.cpp,v'.
Trying pattern rule with stem `main.cpp'.
Trying implicit prerequisite `RCS/main.cpp,v'.
Trying pattern rule with stem `main.cpp'.
Trying implicit prerequisite `RCS/main.cpp'.
Trying pattern rule with stem `main.cpp'.
Trying implicit prerequisite `s.main.cpp'.
Trying pattern rule with stem `main.cpp'.
Trying implicit prerequisite `SCCS/s.main.cpp'
No implicit rule found for `main.cpp'.
Finished prerequisites of target file `main.cp
No need to remake target `main.cpp'.
Finished prerequisites of target file `main.o'.
Prerequisite `main.cpp' is older than target `ma
No need to remake target `main.o'.
Finished prerequisites of target file `project000.
Must remake target `project000.exe'.
g++ -Wall main.o -o project000.exe
Putting child 0x0a020398 (project000.exe) PID 5840
Live child 0x0a020398 (project000.exe) PID 5840
Reaping winning child 0x0a020398 PID 5840
Removing child 0x0a020398 PID 5840 from chain.
Successfully remade target file `project000.exe'.
制作-Rrd输出
This program built for i686-pc-msys
Reading makefiles...
Reading makefile `Makefile'...
Updating makefiles....
Considering target file `Makefile'.
Looking for an implicit rule for `Makefile'.
Looking for a case-insensitive implicit rule for `Makefile'.
No implicit rule found for `Makefile'.
Finished prerequisites of target file `Makefile'.
No need to remake target `Makefile'.
Updating goal targets....
Considering target file `project000.exe'.
File `project000.exe' does not exist.
Considering target file `main.o'.
Considering target file `main.cpp'.
Looking for an implicit rule for `main.cpp'.
Looking for a case-insensitive implicit rule for `main.cpp'.
No implicit rule found for `main.cpp'.
Finished prerequisites of target file `main.cpp'.
No need to remake target `main.cpp'.
Finished prerequisites of target file `main.o'.
Prerequisite `main.cpp' is older than target `main.o'.
No need to remake target `main.o'.
Finished prerequisites of target file `project000.exe'.
Must remake target `project000.exe'.
g++ -Wall main.o -o project000.exe
Putting child 0x0a01a270 (project000.exe) PID 6796 on the chain.
Live child 0x0a01a270 (project000.exe) PID 6796
Reaping winning child 0x0a01a270 PID 6796
Removing child 0x0a01a270 PID 6796 from chain.
Successfully remade target file `project000.exe'.
答案 0 :(得分:0)
Avast Antivirus处于静默模式,它会将每个新的.exe置于隔离状态,而不会通知我。这就是.exe在创建后立即被删除的原因。