Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / Languages / C++

*.pch file missing!

1.00/5 (1 vote)
15 Feb 2010CPOL 44K  
Sometimes, Visual c++ users see a pretty confusing error message when they compile or build their projects. the error message says :fatal error C1083: Cannot open precompiled header file: 'filename.pch': No such file or directorymy solution was :In VS, go to Project->Options, set the...
Sometimes, Visual c++ users see a pretty confusing error message when they compile or build their projects. the error message says :

MSIL
fatal error C1083: Cannot open precompiled header file: 'filename.pch': No such file or directory


my solution was :

MSIL
In VS, go to Project->Options, set the Configuration Combobox in top to 'All Configurations', and then from left pan, choose 'C/C++->Precompiled Haeders' and set 'Create/Use Precompiled headers' option to value : 'Create Precompiled headers (/Yc)'.


which turned out not to be an accurate solution (Read the Messages below).

well, here is the solution :


1) Right click on the PROJECT (in Solution Explorer) | Properties | C/C++ | Pre-compiled Headers... here you set to ** /Yu **
2) Right click on STDAFX.CPP (in Solution Explorer) | Properties | C/C++ | Pre-compiled Headers... here you set to ** /Yc **

its done.

all credits for this tip goes to :SledgeHammer01

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)