天天看点

sublime text 3 c++报错 cannot open output file

报错如下:

下图是我们要执行的程序:

sublime text 3 c++报错 cannot open output file

当我们build后出现如下报错:

sublime text 3 c++报错 cannot open output file

c:/mingw/bin/../lib/gcc/mingw32/5.3.0/../../../../mingw32/bin/ld.exe: cannot open output file

D:\Sublime Text 3 work/experiment1-1.exe: Permission denied

collect2.exe: error: ld returned 1 exit status

原因:

之前编译运行程序后没有退出,导致下一次编译运行无法进行。如下图:

sublime text 3 c++报错 cannot open output file

我们可以看到experiment1-1.exe正在后台运行。

解决方法:

方法一:进入任务管理器,找到正在后台运行的程序,点击结束任务。

sublime text 3 c++报错 cannot open output file

方法二:删掉你工作文件下对应的.exe文件

sublime text 3 c++报错 cannot open output file

继续阅读