致命错误C1010:意外的文件结束 [英] Fatal error C1010: unexpected end of file
本文介绍了致命错误C1010:意外的文件结束的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是我尝试编译时收到的消息。
致命错误C1010:查找预编译头时意外结束文件。您是否忘记在源代码中添加''#include" stdafx.h"''?
This is the message I am getting when I try to compile it.
fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add ''#include "stdafx.h"'' to your source?
展开 | 选择 | 换行 | 行号
推荐答案
您的变量名称不允许有空格:木材类型。使用woodtype或WoodType pr wood_type。
另外,你的if语句不正确。条件必须在括号中。
Your variable names are not allowed to have spaces: wood type. Use woodtype or WoodType pr wood_type.
Also, your if statements are not correct. The condition has to be in parentheses.
展开 | 选择 | Wrap | 行号
非常感谢你。我遇到了很多麻烦,感谢您的帮助!
Thank you so much. I am having alot of trouble and I appreciate all your help!
您已经创建了Windows控制台应用程序而不是控制台应用程序。
对于初学者来说最简单的事情是按如下方式创建一个新项目:
1)创建一个Win32项目。
2)当向导出现时不要点击完成。
3)相反,单击应用程序设置
4)选择:控制台应用程序和空项目
5)单击完成。
这将删除stdafx.h和预编译的头文件要求。
BTW:当你运行程序时,一定要使用Start Without Debugging。这将导致VC ++在main()结束时停止执行,以便您可以看到发生了什么。如果你刚刚开始,你所看到的只是程序执行时的黑色闪光。您在使用调试器时选择开始。
You have created a Windows Console Application rather than a Console Application.
The easiest thing for a beginner is to create a new project as follows:
1) Create a Win32 project.
2) When the wizard appears DO NOT CLICK FINISH.
3) Instead, click Application Settings
4) Select: Console Application and Empty Project
5) Click Finish.
This removes the stdafx.h and pre-compiled header requirements.
BTW: When you run the program be sure to use Start Without Debugging. That will cause VC++ to stop execution at the end of main() so you can see what happened. If you just Start, all you will see is a black flash as your program executed. You select Start when you are using your debugger.
这篇关于致命错误C1010:意外的文件结束的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文