C++ VS Fatal error C1083 Permission denied

cfatal errorpermission-denied

I have searched for hours online trying to find a solution. I'm new to C++, however I've compiled quite a few programs and never had any trouble until last night.

I'm using the Microsoft VS command prompt. I've tried this on 2010, 12, and 13, and get the same error… as well as on 2 different computer systems. I thought it may be a code issue, however, I just typed up a simple program that I know will work, yet I get the same error. I'm running Windows 8 64 bit

From the command prompt I enter cl C:\Users\David\Desktop\1\simplecpp.cpp

and get the following error:

C:\Users\David\Desktop\1\simplecpp.cpp : fatal error C1083: Cannot open compiler generated file: 'simplecpp.obj': Permission denied

I can get the programs to compile if I run as Administrator (what I read on another post) However, there is no output. It doesn't save the object or program files. I have also checked permissions, and everything is correct.

Neither computer has had anything changed, both do use ad-aware, however, I disabled that and tried just in case something was interfering, but still it doesn't work. I also turned off my firewall and tried. I find it odd that both of my computers at the same time are experiencing the same issue?

Best Answer

Ok, I found out what the problem was. I don't know how it happened, but somehow, my Microsoft Visual Studio 10.0 folder permissions for my master account got reset on both of my computers and I didn't have permissions to modify any files. This is the case for other versions I had installed as well.

Possibly a windows update issue? Anyhow, I reset permissions to allow full access, and all is working now!

If anyone else comes across this and is having the same issue, just navigate to your Microsoft Visual Studio 10.0 folder "...Program Files (x86)\Microsoft Visual Studio 10.0" > right click and go to Properties > Click security tab > Click Edit, then the affected user and check full control.

It is, however, saving my project files to the root Microsoft Visual Studio 10.0 folder now.

Thanks