Issue
When I build my c++ solution in Visual Studio it complains that the xxxxx.pch file is missing. Is there a setting I am missing to get the pre-compiled headers back?
here is the exact error for completeness:
Error 1 fatal error C1083: Cannot open precompiled header file: 'Debug\xxxxx.pch': No such file or directory
Solution
NOTE: Later versions of the IDE may use "pch" rather than "stdafx" in the default names for related files. It may be necessary to substitute pch for stdafx in the instructions below. I apologize. It's not my fault.
- Right-click on your project in the Solution Explorer.
- Click Properties at the bottom of the drop-down menu.
- At the top left of the Properties Pages, select All Configurations from the drop-down menu.
- Open the C/C++ tree and select Precompiled Headers
- Precompiled Header: Select Use (/Yu)
- Fill in the Precompiled Header File field. Standard is stdafx.h
Click Okay
If you do not have stdafx.h in your Header Files put it there. Edit it to #include all the headers you want precompiled.
- Put a file named stdafx.cpp into your project. Put #include "stdafx.h" at the top of it, and nothing else.
- Right-click on stdafx.cpp in Solution Explorer. Select Properties and All configurations again as in step 4 ...
- ... but this time select Precompiled Header Create (/Yc). This will only bind to the one file stdafx.cpp.
- Put #include "stdafx.h" at the very top of all your source files.
Lucky 13. Cross your fingers and hit Build.
Answered By - Jive Dadson Answer Checked By - Mildred Charles (PHPFixing Admin)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.