找不到stdafx [英] stdafx not found

查看:109
本文介绍了找不到stdafx的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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 an online 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).

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

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

那么,Visual Studio如何找不到项目中已经存在的文件?它可以在我的家用PC上正常工作,但拒绝在笔记本电脑上工作.

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.

我尝试将预编译的标头设置更改为YU而不是YC,但这不能解决问题.

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

我还可以从解决方案资源管理器中打开文件,并在文件中包含#include< stdafx.h>行.当我右键单击该代码并单击打开"时,它将打开stdafx头文件.

Also I can open the file from the solution explorer, and in the files with the line #include <stdafx.h> when I right click on that code and click open it will open the stdafx header file.

推荐答案

通常是stdafx是用于预编译头"的文件.如果仅构建项目,则不会启动stdafx预编译.您已经重建"了或新建" (嗯,我有VS的德语版.)

The stdafx usually is the file, which is used for "Precompiled Headers". if you just build the projekt, the stdafx-precompilation isn't started. You hav to "rebuild" or "new build" (hmm, I've got a german version of VS).

 

另一种可能性是在项目配置中禁用预编译头.

The other possibility is to disable Precompiled Headers in the project configuration.


这篇关于找不到stdafx的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆