编译时无法创建临时文件
我现在越来越多地发现,当我构建一个大型项目时,我会收到以下错误。
致命错误 C1083:无法打开 编译器中间文件: 'C:\Temp\SYS\a03132ex': 权限 被拒绝
它发生在Visual Studio 2003和VC6中,我调查了潜在的MSDN原因并得出了空白。 硬盘上有足够的空间,并且没有打开太多其他程序,我应该用完句柄。 任何想法,或者是时候再次重新安装 Windows。 顺便说一下,我运行的是 XP SP3,并且有两个大的 NTFS 硬盘,里面有很多文件。
编辑:临时文件的名称发生变化,并且我已经清除了整个 c:\temp 文件夹。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
我似乎记得在记忆深处的某个地方,删除 Visual Studio 为该项目创建的临时文件可以修复此问题(直到它再次弹出)。
临时文件与您的项目同名。 (如果这没有帮助,您的主目录中可能还有与 VC/VS 相关的内容。)
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.)
如果这没有帮助,请检查您的 TMP 环境设置是否不以分号结尾。 它也应该是完全限定的路径,而不是相对的。
编辑:我在互联网上找到了一个关于它的主题,据说,如果您尝试包含目录而不是文件,则可能会触发相同的错误。
我假设您已经验证了这一点,但是实际的 C:\Temp\SYS 文件夹是否具有正确的权限(即允许所有用户读取/写入其中的文件)?
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)?
您还可以检查与
c:\temp
和c:\temp\sys
关联的权限(如果 sys 确实存在于编译会话之外)另外,(如 此处建议),尝试在高级选项下设置编译器标志 -Bd 并检查编译器中的参数。 也许您打算指定一个路径并最终编译一个不存在的文件?
You could also check the rights associated with
c:\temp
andc:\temp\sys
(if sys does exist outside the compilation session)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 ?
保持临时文件位置简单,例如,当我将项目从笔记本电脑复制到办公室 PC 时,VS2003 项目未编译。“tmp”系统变量指向 %USERPROFILE%/TEMP。 Visual Studio 2003 给出了一些“致命错误 C1083:无法打开编译器中间文件:”错误
我在 C 驱动器上创建了一个新的 Temp 文件夹,并将系统变量 TMP 更改为“C:/TEMP”。 重新编译程序,瞧,没有错误了!
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!
不要单击编译器中的重建按钮,仅单击构建按钮 - 这解决了我的问题
do not click Rebuild button in complier, click Build button only - this solve my problem
我有完全相同的问题。 在构建项目时禁用防病毒软件解决了这个问题。 一个可能的永久解决方案是将 VS 的临时目录设置在其他位置并告诉防病毒软件排除该目录。
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.