SmacL
SmacL

Reputation: 22932

Unable to create temporary files while compiling

I find increasingly now when I am building a large project, I get the following error.

fatal error C1083: Cannot open compiler intermediate file: 'C:\Temp\SYS\a03132ex': Permission denied

It occurs in Visual Studio 2003 and VC6, and I have investigated the potential MSDN reasons and drawn a blank. There is plenty of space on the hard disk, and not that many other programs open that I should be running out of handles. Any ideas, or is it time to re-install windows again. I'm running XP SP3 by the way, and have two large NTFS hard disks with very many files.

Edit: the name of the temp file changes, and I have cleared out the entire c:\temp folder.

Upvotes: 2

Views: 9120

Answers (6)

benedict
benedict

Reputation: 1

I had exactly the same issue. Disabling the antivirus while building the project solved that issue. A possible permanent solution would be to setting VS's temporary directory somewhere else and telling the antivirus to exclude that directory.

Upvotes: 0

Khan
Khan

Reputation: 149

do not click Rebuild button in complier, click Build button only - this solve my problem

Upvotes: 0

Waqas
Waqas

Reputation: 3853

Keep your temp file location simple, for example when I copy projects from my laptop to my office PC the VS2003 project didn’t compile.. The “tmp” system variable was pointing to %USERPROFILE%/TEMP. Visual studio 2003 was giving few "Fatal error C1083: Cannot open compiler intermediate file:" errors

I made a new Temp folder on C drive and change the system variable TMP to "C:/TEMP". Recompiled the program and Voilà no errors!

Upvotes: 1

VonC
VonC

Reputation: 1328172

You could also check the rights associated with c:\temp and c:\temp\sys (if sys does exist outside the compilation session)

cacls c:\temp

Also, (as suggested here), try setting the compiler flag -Bd under advanced options and inspect the arguments into the compiler. Maybe you meant to specify a path and end up compiling a non-existant file ?

Upvotes: 1

Blizz
Blizz

Reputation: 8408

And if that doesn't help, check if your TMP environment setting doesn't end with a semicolon for example. It should be a fully qualified path as well, not relative.

Edit: I found a topic on the internet about it and there it is said that if you attempt to include a directory instead of a file you can trigger that very same error.

I assume you already verified this, but does the actual C:\Temp\SYS folder have the correct permissions (ie allow all users to read/write files in it)?

Upvotes: 2

krosenvold
krosenvold

Reputation: 77201

I seem to remember from somewhere deep down memory lane that deleting the temporary files created by visual studio for the project fixes this issue (until it pops up again).

The temporary files have the same name as your project. (There may also be something VC/VS related in your home directory if that does not help.)

Upvotes: 3

Related Questions