c++致命错误 c1083 项目以前没问题,现在怎么办?

发布于 2024-08-21 17:49:58 字数 151 浏览 3 评论 0原文

我有一个 (com) c++ 项目,它使用 (.net) c++ dll。该项目已编译并运行正常。

现在,我所做的只是对 dll 进行更改,并且在重新编译我的 (com) 项目时收到致命错误 c1083-无法打开包含文件 stdafx.h。

这意味着什么?

I have a (com) c++ project, which uses a (.net) c++ dll. The project was compiling and running ok.

Now, all I did was make changes to the dll, and I'm getting a fatal error c1083- cannot open include file stdafx.h - when recompiling my (com) project.

What can this mean?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

山田美奈子 2024-08-28 17:49:58

寻找你的stdafx.h。以下是可能性:

  1. 如果没有丢失,请尝试重新启动计算机。您还可以使用 sysinternals 的 handle.exe 来找出谁持有该文件。
  2. 如果缺少,请创建它。
  3. 另一方面,也有可能您的项目最初并没有使用预编译头,并且错误地打开了该选项。因此,请在项目属性中关闭预编译头选项。

Look for your stdafx.h. Here are the possibilities:

  1. If it isn't missing, try restarting you machine. You could also use sysinternals' handle.exe to find out who's holding that file.
  2. If it is missing, create it.
  3. On the other hand, it may be possible that your project did not originally use pre-compiled headers and the option was turned on in error. So, switch off the pre-compiled header option in project properties.
是伱的 2024-08-28 17:49:58

如果您的 include 语句使用尖括号:

#include <stdafx.h>

...尝试将其更改为使用引号:

#include "stdafx.h"

这两个不同的。当您使用引号时,您告诉编译器“好的,首先搜索本地目录,然后转到搜索路径。”但是,当您使用尖括号时,您告诉编译器“不要在本地目录中查找,只需搜索搜索路径”。对于 stdafx.h,您需要属于项目的一部分,因此您需要首先搜索本地目录。

这让我有些恼火,但那是另一部剧的故事了……

If your include statement uses angle brackets:

#include <stdafx.h>

...try changing it to use quotes instead:

#include "stdafx.h"

The two are different. When you use quotes you tell the compiler "ok first search the local directory, then go to the search path." But when you use angle brackets you tell the compiler "DONT look in the local directory, just search the search path." In the case of stdafx.h you want the one that is part of the project, so you want to search the local directory first.

Which brings me to a pet peeve of mine, but that's a story for another show...

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