'VS code error "Permission Denied" when printing simple output
I am trying to set up my c++ environment in Visual Code Studio but the error here is Permission denied and I tried giving it administrator permission but it didn't work out.
This is the code :
#include<iostream>
using namespace std;
int main()
{
cout<<"Hello World";
return 0;
}
This is the error
PS D:\Work\VS Code\C++> cd "d:\Work\VS Code\C++\" ; if ($?) { g++ 1.cpp -o 1 } ; if ($?) { .\1 }
c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: cannot open output file 1.exe: Permission denied
collect2.exe: error: ld returned 1 exit status
Solution 1:[1]
I solved it by removing all of "tasks.json" content and going to Terminal->Configure Default Build task then I selected
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | YASSINE |