寻求与 Visual C++ 的文件名冲突的解决方法 头文件

发布于 2024-07-24 04:51:54 字数 608 浏览 3 评论 0原文

我们的代码包括 vector,其中包括 memory,其中包括 Microsoft 的 intrin.h,但我们有一个 intrin.h > 我们自己的包含路径。 因此,memory 选择了我们的 intrin.h 而不是系统的,并且无法编译。

我们的 intrin.h 和 Microsoft 的都已存在多年,但我们之前从未发生过冲突 - VS 2010 引入了新的依赖项。 移动或重命名我们的 intrin.h 会很痛苦,我宁愿避免它。

有什么方法可以说服 MSVC 在我们自己的目录之前先查看系统包含目录吗? 编辑内存说:

#include "intrin.h"

而不是

#include <intrin.h>

有效,但我不希望整个团队必须修改他们的Visual Studio环境(并在面对服务包等时保持修改)

任何其他解决这个问题的方法?

Our code includes vector, which includes memory, which includes Microsoft's intrin.h, but we have an intrin.h of our own on our include path. Hence memory picks up our intrin.h instead of the system one, and fails to compile.

Both our intrin.h and Microsoft's have been around for years, but we've never had a conflict before - VS 2010 introduces a new dependency. Moving or renaming our intrin.h would be a pain, and I'd rather avoid it.

Is there some way I can persuade MSVC to look in the system include directory before our own? Editing memory to say:

#include "intrin.h"

rather than

#include <intrin.h>

works, but I don't want the whole team to have to modify their Visual Studio environments (and keep them modified in the face of service packs, etc.)

Any other way of working around this?

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

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

发布评论

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

评论(1

夜唯美灬不弃 2024-07-31 04:51:54

只需将系统包含目录添加到目录之前的包含路径怎么样?

How about simply adding the system include directory to the include path before your directory?

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