错误 2 error C1010: 在查找预编译头时遇到意外的文件结尾。是否忘记了向源中添加“#include "stdafx.h"”?
2018-02-01 15:48
344 查看
错误分析
此错误发生的原因是编译器在寻找预编译指示头文件(默认#include "stdafx.h")时,没有找预编译指示信息的头文件"stdafx.h"。
因为工程中的每个cpp文件属性默认都是使用预编译(/YU)的,但是添加的第三方文件并没有该预编译指示头文件,所以编译器在此cpp文件中一直到末尾都没有找到它。
解决方法
·右击报错的cpp文件,选择"属性"
·左侧配置属性中打开"C/C++"下拉菜单
·点击"预编译头",右侧对话框中找"预编译头"选项,把"使用(/Yu)"改写不使用"不使用预编译头"。
此错误发生的原因是编译器在寻找预编译指示头文件(默认#include "stdafx.h")时,没有找预编译指示信息的头文件"stdafx.h"。
因为工程中的每个cpp文件属性默认都是使用预编译(/YU)的,但是添加的第三方文件并没有该预编译指示头文件,所以编译器在此cpp文件中一直到末尾都没有找到它。
解决方法
·右击报错的cpp文件,选择"属性"
·左侧配置属性中打开"C/C++"下拉菜单
·点击"预编译头",右侧对话框中找"预编译头"选项,把"使用(/Yu)"改写不使用"不使用预编译头"。
相关文章推荐
- 错误 16 error C1010: 在查找预编译头时遇到意外的文件结尾。是否忘记了向源中添加“#include "StdAfx.h"”?
- 错误 1 error C1010: 在查找预编译头时遇到意外的文件结尾。是否忘记了向源中添加“#include "stdafx.h"”?
- 错误 2 error C1010: 在查找预编译头时遇到意外的文件结尾。是否忘记了向源中添加“#include "stdafx.h"”?
- 错误 1 error C1010: 在查找预编译头时遇到意外的文件结尾。是否忘记了向源中添加“#include "stdafx.h"”?
- 错误描述:fatal error C1010: 在查找预编译头时遇到意外的文件结尾。是否忘记了向源中添加“#include "stdafx.h"”?
- 错误描述:fatal error C1010:在查找预编译头时遇到意外的文件结尾。是否忘记了向源中添加“#include"stdafx.h"”?
- error C1010: 在查找预编译头时遇到意外的文件结尾。是否忘记了向源中添加“#include "StdAfx.h"”?
- 错误描述:fatal error C1010:在查找预编译头时遇到意外的文件结尾。是否忘记了向源中添加“#include"stdafx.h"”?
- error C1010: 在查找预编译头时遇到意外的文件结尾。是否忘记了向源中添加“#include "stdafx.h"
- 错误:在查找预编译头时遇到意外的文件结尾。是否忘记了向源中添加"#include"stdafx.h""
- error C1010: 在查找预编译头时遇到意外的文件结尾。是否忘记了向源中添加“#include "StdAfx.h"”?
- 错误描述:fatal error C1010: 在查找预编译头时遇到意外的文件结尾。是否忘记了向源中添加“#include "stdafx.h"”?
- error C1010: 在查找预编译头时遇到意外的文件结尾。是否忘记了向源中添加“#include "stdafx.h”
- 错误描述:fatal error C1010:在查找预编译头时遇到意外的文件结尾。是否忘记了向源中添加“#include"stdafx.h"”?
- fatal error C1010: 在查找预编译头时遇到意外的文件结尾。是否忘记了向源中添加“#include "stdafx.h
- fatal error C1010: 在查找预编译头时遇到意外的文件结尾。是否忘记了向源中添加“#include "stdafx.h
- fatal error C1010: 在查找预编译头时遇到意外的文件结尾。是否忘记了向源中添加“#include "stdafx.h
- fatal error C1010: 在查找预编译头时遇到意外的文件结尾。是否忘记了向源中添加“#include "stdafx.h
- fatal error C1010: 在查找预编译头时遇到意外的文件结尾。是否忘记了向源中添加“#include "stdafx.h
- fatal error C1010: 在查找预编译头时遇到意外的文件结尾。是否忘记了向源中添加“#include "stdafx.h