当我在 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;
}
我尝试了堆栈和其他论坛的一些解决方案,但没有成功,虽然其他论坛没有什么,但在堆栈上我找到了一个可以打开“应用程序体验”的解决方案,但不幸的是我在 services.msc 上找不到它
任何帮助都感激不尽。谢谢你。