编译时无法创建临时文件

发布于 2024-07-11 04:55:29 字数 364 浏览 11 评论 0原文

我现在越来越多地发现,当我构建一个大型项目时,我会收到以下错误。

致命错误 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

无声无音无过去 2024-07-18 04:55:29

我似乎记得在记忆深处的某个地方,删除 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.)

破晓 2024-07-18 04:55:29

如果这没有帮助,请检查您的 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)?

情徒 2024-07-18 04:55:29

您还可以检查与 c:\tempc:\temp\sys 关联的权限(如果 sys 确实存在于编译会话之外)

cacls c:\temp

另外,(如 此处建议),尝试在高级选项下设置编译器标志 -Bd 并检查编译器中的参数。 也许您打算指定一个路径并最终编译一个不存在的文件?

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 ?

暖伴 2024-07-18 04:55:29

保持临时文件位置简单,例如,当我将项目从笔记本电脑复制到办公室 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!

最偏执的依靠 2024-07-18 04:55:29

不要单击编译器中的重建按钮,仅单击构建按钮 - 这解决了我的问题

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

酷到爆炸 2024-07-18 04:55:29

我有完全相同的问题。 在构建项目时禁用防病毒软件解决了这个问题。 一个可能的永久解决方案是将 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文