Jump to content
  • Advertisement
Sign in to follow this  
supagu

VC++ PCH issues

This topic is 3933 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

well, i have a very large project which takes a very long time to compile if i dont use a precompiled header. Now It compiles fine in debug mode with: Use Precompiled Header (/Yu) but, release mode wont compile, it says: fatal error C1083: Cannot open precompiled header file: 'Release2\DogFighters.pch': No such file or directory now, this is very weird, as i have made release2 exactly the same as debug except main project uses: Multi-threaded (/MT) and all other lib generating projects are using my normal release mode. here is the first line from my build log:
/Od /I "d:\Programming\BlackCarbon\Library" /I "d:\Programming\BlackCarbon\Project\DogFighters\Source" /I "d:\Programming\BlackCarbon\Library\Sound\\" /I "d:\Programming\BlackCarbon\GameLibrary" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "DEBUG" /D "SOFTWARE" /D "OGL" /D "_CRT_SECURE_NO_WARNINGS" /D "_UNICODE" /D "UNICODE" /Gm /EHsc /RTC1 /MT /Yu"stdafx.h" /Fp"Release2\DogFighters.pch" /Fo"Release2\\" /Fd"Release2\vc90.pdb" /W3 /c /ZI /TP ..\..\..\GameLibrary\Game\FlashMenu.cpp

/Od /I "d:\Programming\BlackCarbon\Library" /I "d:\Programming\BlackCarbon\Project\DogFighters\Source" /I "d:\Programming\BlackCarbon\Library\Sound\\" /I "d:\Programming\BlackCarbon\GameLibrary" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "DEBUG" /D "SOFTWARE" /D "OGL" /D "_CRT_SECURE_NO_WARNINGS" /D "_UNICODE" /D "UNICODE" /Gm /EHsc /RTC1 /MTd /Yu"stdafx.h" /Fp"Debug\DogFighters.pch" /Fo"Debug\\" /Fd"Debug\vc90.pdb" /W3 /c /ZI /TP .\StdAfx.cpp
as you can see these are exactly the same except for output location and the first file the gets compiled. I've also tried making a new configuration which is exactly the same as debug, and also creates new configurations for each project based off of debug, and this 2 does not compile! how can this be?!?!

Share this post


Link to post
Share on other sites
Advertisement
To get PCH to work you need one file in the project (usually stdafx.cpp) compiled with /Yc (create PCH file) instead of /Yu (use PCH file).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!