Skip to main content
GameDev.net gamedev.net
🔒 Locked

VC++ PCH issues

Started by supagu Mar 5, 2008 at 6:21 AM 2 replies 1.1k views
Original Post
supagu
supagu
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?!?!
Adam_42
Adam_42
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).
supagu
supagu
how do i set this up?
Adam_42
Adam_42
You just right click the stdafx.cpp file in the solution, and select properties.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.