Problem Compiling in Release Mode

May 9, 2012 at 4:24am
Hello. I have created a program in debug mode. I am trying for the first time to compile the program in release mode to increase performance. I am running visual c++ 2010 express. My program runs fine in debug mode but when I try to run it in release mode I get the following message for all my cpp files:

Error 1 error C1083: Cannot open precompiled header file: 'Release\file.pch': No such file or directory

What does this error mean and how do I fix it??????


May 9, 2012 at 5:45am
You probably have your release mode settings set differently from the debug, and the release is check for some precompiled header. If you go into the options, you can adjust that. I'd also run through the other options and compare your release to debug and see if anything else needs changing.
May 9, 2012 at 9:39am
Error 1 error C1083: Cannot open precompiled header file: 'Release\file.pch': No such file or directory 


You got the anser from you output :)

You have to create a precompiled header your self because visual studio does not do that for you (it does only first time)

Here are the steps on how to solve this problem:
Set up your compiler to release mode.
Right click on solution and click clean solution.
Right click your poject name and naviage to:
Configuration properties > C\C++ > Precomiled headers > Precomiled header > set to Creae \Yc
Click OK and close property page.

Hit F7 to build your solution.

Now you have created an precompiled header,

Next do this:
Right click your poject name and naviage to:
Configuration properties > C\C++ > Precomiled headers > Precomiled header > set to Use \Yu
Click OK and close property page.

Hit F7 to build your solution.
Hit F5 to start debuging.

Hope this help.


edit:
This of course assumes you have a header in yuor project whose name is the same as one stored in
Configuration properties > C\C++ > Precomiled headers > Precompiled header file.
Last edited on May 9, 2012 at 9:48am
Topic archived. No new replies allowed.