关于VC编译错误fatal error C1083的解决办法
2006-04-19 13:29
381 查看
错误总是不断的,经验是累积的。
C1083: Cannot open precompiled header file: 'Debug/<Project-Name>.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了。
C1083: Cannot open precompiled header file: 'Debug/<Project-Name>.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了。
相关文章推荐
- 关于VC编译错误error LNK2001:的解决办法
- 关于VC编译错误fatal error C1083的解决办法
- 关于VC编译错误fatal error C1083的解决办法
- 关于VC编译错误fatal error C1083的解决办法
- 关于Matlab编译生成jar包时出现错误的解决办法
- VC经典的编译错误解决办法(转载)
- 关于ARM交叉编译工具出现:assertion fail elf32-arm.c:12387 的错误解决办法。
- VC经典的编译错误解决办法(转载)
- 关于Visual Studio 2013 编译 multi-byte character set MFC程序出现 MSB8031 错误的解决办法
- 关于Visual Studio 2013 编译 multi-byte character set MFC程序出现 MSB8031 错误的解决办法
- 关于VS2017编译linux程序时,错误提示信息太简单,看不出错误原因的解决办法
- 关于ADS编译错误 error U1077 C:/Program 返回0x01 的解决办法
- 关于Visual Studio 2013 编译 multi-byte character set MFC程序出现 MSB8031 错误的解决办法
- 关于Visual Studio 2013 编译 multi-byte character set MFC程序出现 MSB8031 错误的解决办法
- 关于tao_idl编译错误的解决办法
- 关于Visual Studio 2013 编译 multi-byte character set MFC程序出现 MSB8031 错误的解决办法
- VC编译程序错误Error spawning的解决办法
- 关于unix高级环境编程(apue)编译时的err_sys和err_quit错误的解决办法
- 安装BCGControlBar 编译错误解决办法 fatal error C1033: cannot open program database '*:/**/vc60.idb'
- 关于类似“unresolved external……”这类编译错误的解决办法