VC Fatal Error C1083的几种解决方案

遇到的问题:

情况1:

Fatal Error C1083: Cannot open precompiled header file: 'Debug/.pch': No such file or directory

This error results from a missing file - the compiled version of StdAfx.cpp. Visual C++ does a poor job of keeping track of this file and frequently "forgets" how to build it. This problem often occurs after restoring a saved workspace from diskette without the Debug directory. To fix the error select StdAfx.cpp from the workspace file list them choose Compile from the Build menu.  If that doesn't work the go to Project -> Settings, select the C/C++ tab, and click the radio button labeled Create Precompiled Headers.

Unexpected end while looking for precompiled header

这时因为该模块没有包括预编译头文件“stdafx.h”的缘故。

VC用一个stdafx.cpp包含头文件stdafx.h,然后在stdafx.h里包含大部分系统头文件,这样编译时VC就通过编译stdafx.cpp把大部分系统头文件预编译进来了,在Debug目录下有一个很大的文件*.pch,这里就存储了预编译信息。

根据这个原理,如果这个pch损坏了或被删除了,系统重新编译时就会抱怨“cannot open precompiled header file debug/*.pch”。这时怎么解决这个问题呢,打开Project-》Setting对话框选C++页,将Category下拉式列表框选中Precompiled Headers,最简单的办法就是选中第一个选项“Not using....",这样就根本不用预编译头也不去寻找pch文件,就不会出错了,但是这样做的后果是每次编译、连接都化更多的时间。

也可以选第二个选项”Automatic ...",然后在“Through header”力填上stdafx.h,这样如果没有pch文件系统会自动生成一个pch,如果有的话就使用这个pch,这个选项是比较“智能”的。

第三个选项是强行创建一个pch文件。

第四个选项是直接使用pch文件。当然“Through headers”里都填stdafx.h了。

情况2:

遇到的问题:

Fatal Error C1083: Cannot open  header file: '*.h': No such file or directory

If an include file could not be opened, check that the INCLUDE environment variable is set correctly and that the name of the file is spelled correctly.

Using double quotation marks around a complete path specification in a #include directive causes the standard directories to NOT be searched.

解决方法:

1. 首先检查头文件是否有拼写错误。

2. 检查头文件的环境变量是否设置正确。

3. 自己写的头文件用双引号引起来。例如#include "test.h"

查看评论

vc语言c1083错误,VC Fatal Error C1083的几种解决方案相关推荐

  1. 【VC++2010无法debug】fatal error C1083: 无法打开包括文件:“stdio.h”: No such file or directory【问题解决】

    [VC++2010无法debug]fatal error C1083: 无法打开包括文件:"stdio.h": No such file or directory[问题解决] st ...

  2. VC++ 常见调试错误:fatal error LNK1561: entry point must be defined

    今天在对软件调试时,碰到一个连接错误"fatal error LNK1561: entry point must be defined",查了很多资料都没能够解决,最终查到是连接命 ...

  3. fatal error C1083: 无法打开包括文件:“stdint.h”: No such file or directory

    fatal error C1083: 无法打开包括文件:"stdint.h": No such file or directory [错误]fatal error C1083: 无 ...

  4. fatal error C1083: 无法打开包括文件:dxtrans.h: No such file or directory

    From: http://blog.csdn.net/pkueecser/article/details/7287938 fatal error C1083: 无法打开包括文件:"dxtra ...

  5. fatal error C1083: Cannot open include file: 'iostream.h': No such file or dire

    错误: fatal error C1083: Cannot open include file: 'iostream.h': No such file or directory 我的源代码测试回调函数 ...

  6. fatal error C1083: 无法打开包括文件: “afx.h”: No such file or directory

      在用Visual Studio 2017打开一个工程进行编译时,报了如下错误: fatal error C1083: 无法打开包括文件: "afx.h": No such fi ...

  7. 关于编译错误 fatal error C1083: Cannot open precompiled header file

        今天编译一个比较大的工程时,总是遇到这样的编译错误,想必凡是用过VC6.0做过比较大的程序或者做过MFC开发的朋友都遇到过.错误提示如下,fatal error C1083:Cannot op ...

  8. fatal error C1083: Cannot open source file

    在VS2008  VC++项目中,新建了一个cpp文件,然后在物理硬盘上手动删除了,就出现如下错误. 1>------ Build started: Project: test, Configu ...

  9. fatal error C1083: Cannot open include file: 'uxtheme.h'的解决

    最近做一个系统时,苦于界面比较难看,如果自己从头做起的话,过于烦琐,便上网,寻找合适的界面库,找了多个,发现了一个比较合适的界面库GuiLib(官方网址:www.beyondata.com),这个界面 ...

  10. fatal error C1083: 无法打开包括文件:“pcap.h”: WinPcap编程

    WinPcap是一个开源的.运行于Win32平台下的体系结构,它的主要功能是进行数据包捕获和网络分析.它允许应用程序通过协议栈捕获和传输网络数据包,也包括内核级别的数据包过滤.网络静态引擎和支持远程数 ...

最新文章

  1. elasticsearch-php使用scroll深度分页处理数据(附代码)
  2. 服务器 新文件病毒扫描,部署 Seafile 专业版服务器
  3. 利用qsort二级排序
  4. 学术联赛 | 运用知识图谱技术,赋能多领域应用 ——“未来杯”AI学术联赛总决赛暨颁奖典礼圆满落幕...
  5. 懒人看执行计划神器 for Oracle
  6. iOS 3DTouch
  7. [转]论acm与泡妞
  8. U盘美化(更换U盘logo和页面背景软件)
  9. python 获取进程id_使用python 获取进程pid号的方法
  10. qt html5播放器,Qt实现网络播放器
  11. 【CSS 基础教程】
  12. mobi电子书如何用安卓手机打开?
  13. 制图中比例尺的一些问题
  14. 有道词典java下载电脑版下载手机版下载安装_有道词典下载安装_有道词典app下载「官方版」-太平洋下载中心...
  15. 【读书摘记】《黄金时代》 -王小波
  16. 谈谈如何发起一次会议
  17. ThreeJS 骨架图显示、骨骼修改颜色
  18. java-数组常用api
  19. Flink实操 : 算子操作
  20. 【upload导入、导出】

热门文章

  1. java精选视频资源,收藏慢慢看!
  2. 矩阵代数(四)- 分块矩阵
  3. 上海海洋大学计算机二级成绩,上海海洋大学是几本 2018分数线是多少分
  4. Bootstrap-table 如何合并相同单元格
  5. 32位计算机64位计算机实质,4G内存电脑安装32位还是64位win7系统?实际详细性能测试!...
  6. html页面添加动态动画小人,博客页面添加动态小人
  7. 第六学:binder---client与server向SM的求学之路
  8. 强大数定律与弱大数定律(民科解释)
  9. HTML视频自动播放
  10. Kmplayer硬件解码高清视频优化设置