This is my first project with Visual Studio Code. When i go to run my "Hello World" project I get this
cd "c:\Users\imaco\Desktop\Cpppractice" && g++ main.cpp -o main && "c:\Users\imaco\Desktop\Cpppractice"main c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: cannot open output file main.exe: Permission denied collect2.exe: error: ld returned 1 exit status
my code reads
1 #include <iostream>
2
3
4
5 int main()
6 {
7 std:: cout << "Hello World!";
8 }
-I've made sure it isn't running in the background. -I've closed and reopened the program and ran the code again with same results. -I've allowed it as an exception in Bit Defender.
Any help would be greatly appreciated!!
collect2.exeis locked by the OS. Google "Windows find locked file" or something. There are programs you can use which will tell you what files are using what files so you can end the proper task. - Andycollect2.exei get 0 matching results. - Michael DeAngelisLockHunter-- it integrates into Windows Explorer. You just right-click on it and it will tell you what is locking it. If it comes up with nothing, manually delete the file and try again. - Andy"c:\Users\imaco\Desktop\Cpppractice"mainThere's a backslash missing between Cpppractice and main. - john