Error on output screen

c:/mingw/bin/…/lib/gcc/mingw32/6.3.0/…/…/…/…/mingw32/bin/ld.exe: cannot open output file C:\MinGW/helloworld.exe: Permission denied
collect2.exe: error: ld returned 1 exit status
[Finished in 0.5s with exit code 1]
[shell_cmd: g++ “C:\MinGW\helloworld.cpp” -o “C:\MinGW/helloworld” && “C:\MinGW/helloworld”]
[dir: C:\MinGW]
[path: C:\MinGW\bin]

please help me in solving this issue. i cannot find its solution on stack overflow

Add the path to your Mingw-w64 bin folder to the Windows PATH environment variable by using the following steps:

  1. In the Windows search bar, type ‘settings’ to open your Windows Settings.
  2. Search for Edit environment variables for your account .
  3. Choose the Path variable and then select Edit .
  4. Select New and add the Mingw-w64 path to the system path. The exact path depends on which version of Mingw-w64 you have installed and where you installed it. If you used the settings above to install Mingw-w64, then add this to the path: C:\Program Files\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin .
  5. Select OK to save the updated PATH. You will need to reopen any console windows for the new PATH location to be available.
Check your MinGW installation

To check that your Mingw-w64 tools are correctly installed and available, open a new Command Prompt and type:

g++ --version

bro it is already done. g++ is already installed

have you added the path also??

if path also added

then try this one

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.