【发布时间】:2020-07-20 10:02:44
【问题描述】:
当我在 Visual Studio Code 上运行以下给定代码时,首先构建它,但它显示:
> Executing task: g++ -g main.cpp <
d:/software/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: cannot open output file a.exe: Permission denied
collect2.exe: error: ld returned 1 exit status
The terminal process "C:\Program Files\Git\bin\bash.exe '-c', 'g++ -g main.cpp'" terminated with exit code: 1.
Terminal will be reused by tasks, press any key to close it.
我的系统上有 Bitdefender 防病毒软件。它显示一个描述“检测到受感染文件”的错误,它检测到 a.exe 文件,然后我将其从隔离区中删除并从 Bitdefender 软件中删除了该文件,但现在我无法运行 cpp 文件。
#include <iostream>
using namespace std;
class Aclass
{
public:
int x = 0, y = 0;
Aclass() { cout << "constructor of Aclass" << endl; }
}
int main () {
Aclass b;
}
我尝试了堆栈和其他论坛的一些解决方案,但没有成功,虽然其他论坛没有什么,但在堆栈上我找到了一个可以打开“应用程序体验”的解决方案,但不幸的是我在服务上找不到它。 MSC
任何帮助将不胜感激。谢谢。
【问题讨论】:
-
程序应该做什么?它现在什么都不做。为什么要把
class放在类名中。 -
@rioV8 实际上这是一个虚拟代码,只是一小部分。并且这里的代码显示“Aclass的构造函数”。
-
不使用此代码
-
哦,是的。我很抱歉。谢谢@rioV8。我编辑了问题。
-
@Leprachon,你为什么删除你的最后一个问题:stackoverflow.com/questions/63440538/…。我正要给你一些绘画技巧。
标签: visual-studio-code mingw bitdefender