我如何拍摄stdafx.h?

发布于 2024-09-11 13:41:12 字数 401 浏览 2 评论 0原文

我正在使用 Visual Studio 2010 用 C++ 和 OpenGL 制作 3D 模型。我在家用电脑上启动了一个项目,然后决定将其放入存储库中,这样我就可以在笔记本电脑上获取用于开发的代码,而不必继续在两台计算机之间传输文件(也只是为了获得一些练习)使用源代码控制)。

我遇到的问题是,当我在笔记本电脑上加载项目并尝试构建它时,我收到一条错误消息,指出找不到 stdafx.h。 stdafx.h 文件包含在头文件文件夹中,当我单击它时,相对路径只是 stdafx.h

那么 Visual Studio 如何找不到项目中已有的文件呢?它在我的家用电脑上运行良好,但在我的笔记本电脑上无法运行。

我尝试将预编译头设置更改为 YU 而不是 YC,但这并没有解决问题。

我想我在这里忽略了一些基本的东西,但我无法弄清楚。

I am using Visual Studio 2010 to make a 3D model in C++ and OpenGL. I started a project on my home pc, and then decided to put it in a repository, so that I could get the code for development on my laptop and not have to keep transferring files between the two computers (and also just to get some practice at using source control).

The problem I have is that when I load the project on my laptop and try to build it I get an error saying that stdafx.h can not be found. The stdafx.h file is included in the header files folder, and when I click on it the relative path is just stdafx.h

So how then can Visual Studio not find a file that is already in the project? It works fine on my home pc but refuses to work on my laptop.

I have tried changing the precompiled header settings to YU instead of YC but this did not fix the problem.

I imagine I am overlooking something fundamental here but I can’t figure it out.

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

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

发布评论

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

评论(1

唔猫 2024-09-18 13:41:12

当我遇到应用程序在我认为应该查找的位置找不到文件的情况时,我总是运行 ProcMon ( http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx )。

百分之九十九的情况下,你会发现它正在执行以下操作之一:

  • 首先在其他地方找到错误的文件
  • 没有在我认为它正在查找的地方
  • 查找 找到正确的文件,但缺乏打开它的权限。

启动 ProcMon,并过滤包含 stdafx.h 的路径。
然后编译并看看会得到什么。

What I have situations where an application can't find a file in the place where I think it should be looking, I always run ProcMon ( http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx ).

99 times out of 100, you'll find it's doing one of the following:

  • Finding the wrong file somewhere else first
  • Not looking in the place I thought it was looking
  • Finding the right file, but lacking permission to open it.

Start ProcMon, and filter on Paths which Contain stdafx.h.
Then compile and see what you get.

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