Error:fatal error C1010: unexpected end of file while looking for precompiled head

简介: Error:fatal error C1010: unexpected end of file while looking for precompiled head

场景:

VC6.0进行编写C++代码时,创建了一个**简单的程序【s】**然后编译就爆出这个错误

场景复现(创建流程)

点击左上角的【文件】-》然后点击【新建】。


在左上方选择工程,然后下方选择【Win32 Console Application】,在右侧填写工程名称并设置工程路径,然后勾选下侧的创建新的工程空间【R】,然后点击确定

这里中间点击下一步即可。其实我重新创建的时候就发现了这里其实是有说明的,人家就告诉你了需要添加stdafx.h头文件。



这里左侧是一个工程详细,中间的333.cpp中就已经包含了stdafgx.h头文件

可以看到编译都通过不了


解决方案:

方法一

其实你看到这里的时候,你应该知道怎么解决了。那就是主动在文件开头添加包含stdafx.h头文件。

方法二

那么其实还有另一种方法就是设置工程属性。

右击工程,然后点击设置(s)/Settings

选择右上方的C/C++,然后再分类这块选择预编译的头文件/Precomplie Header,然后在下方选择不适用预补偿页眉/Not using precomplie headers。

不添加头文件也能搞到。


C++常见错误

fatal error C1189: #error: STL1003: Unexpected compiler, expected C++ compiler


error C2041: illegal digit ‘9‘ for base ‘8‘ | error C2059: syntax error: ‘bad suffix on number‘


Error:QSqlDatabase: QMYSQL driver not loaded (Qt+C++ 找不到mysql的驱动)


Qt5Error:msvc-version.conf loaded but QMAKE_MSC_VER ins‘t set


Error:E0415 no suitable constructor exists to convert from “int“ to “Rational“


Error:E0415 no suitable constructor exists to convert from “int“ to “Rational“

目录
打赏
0
0
0
0
8
分享
相关文章
【Deepin 20系统】解决Check failed: err == cudaSuccess || err == cudaErrorInvalidValue Unexpected CUDA erro
本文介绍了在使用Nvidia RTX 2070 GPU和TensorFlow 2时,解决GPU内存不足错误的方法,包括杀死占用内存的进程、重置GPU以及重启设备等方案。
133 3
|
11月前
|
SQL
WARNING: too many parse errors' in the 12.2 Alert.log
WARNING: too many parse errors' in the 12.2 Alert.log
106 2
|
11月前
|
syntax error: unexpected end of file
syntax error: unexpected end of file
48 0
error C2449: found ‘{‘ at file scope (missing function header?)和error C2059: syntax error : ‘}‘
error C2449: found ‘{‘ at file scope (missing function header?)和error C2059: syntax error : ‘}‘
161 0
|
11月前
|
解决(error) ERR Errors trying to SHUTDOWN. Check logs.问题~
解决(error) ERR Errors trying to SHUTDOWN. Check logs.问题~
334 0
使用errors.Wrapf()代替log.Error()
使用errors.Wrapf()代替log.Error()
78 0
ERR Errors trying to SHUTDOWN. Check logs.
ERR Errors trying to SHUTDOWN. Check logs.
151 0
Error:error C2601: ‘b‘ : local function definitions are illegal error C2063: ‘b‘ : not a function
Error:error C2601: ‘b‘ : local function definitions are illegal error C2063: ‘b‘ : not a function
245 0
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1179)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1179)
529 0
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等