我如何拍摄stdafx.h?
我正在使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当我遇到应用程序在我认为应该查找的位置找不到文件的情况时,我总是运行 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:
Start ProcMon, and filter on Paths which Contain stdafx.h.
Then compile and see what you get.