[mingw] cc1plus permission denied

im using mingw and im trying to compile my code using the following command:
g++ *.cpp -out test.exe -m32 -std=c++11 -I..\Include\ -I..\Lib\32\SFML-2.4.2\include
\ -L..\Lib\32\SFML-2.4.2\lib\ -lsfml-main -lsfml-graphics -lsfml-system -lsfml-window

but when i do i get the following error:
cc1plus.exe: fatal error: can't open 'C:\Users\stav\AppData\Local\Temp\ccSNL3St.s' for writing: Permission denied
compilation terminated. 

anyone know whats going wrong?
Last edited on
you have tried to write into a folder that your current windows login cannot write into. You either need to write into another folder, or change permissions on it so you can write there.

Given the path, this is either another user's folder or you have left windows to its own devices on security and it is 'protecting' you, lol.

the easy way out is just make a folder on c:\folderhere\ and write there. If you must have it in that place, see if you can force windows to let go. It should let you if you are the admin of the machine.

Last edited on
g++ is trying to create temporary assembly files in your Temp dir.

I have never seen this error, but apparently some google searches does show some similar results, although mostly on Linux it seems, funnily enough.
One random idea is that your temp folder is full. Try deleting some files from it.

If that doesn't work, then jonnin is probably right, it's Windows or your MinGW copy being dumb (more so the former).
Navigate to C:\Users\stav\AppData\Local and then right click Temp -> Properties and go to the Security tab, and then give your user name or group Full Control. Note that AppData is a hidden folder by default. Hope that solves it.
Last edited on
Does MinGW's G++ support the -pipe argument? This is supposed to suppress the generation of temporary files in favor of shell pipes.

If yes, that might be an acceptable work-around. (I don't know for sure, just speculating.)
Last edited on
Registered users can post here. Sign in or register to post.