joannabanana
asked on
Debug vs Release mode - Cannot open include file: 'stdafx.h'
I have a fairly complex application which compiles fine in Debug mode (in Visual Studio .NET) but when I switch to Release mode I get the error:
fatal error C1083: Cannot open include file: 'stdafx.h': No such file or directory
The #include "stdafx.h" that this error refers to is from a file that was developed outside my project (ie. I added the .cpp and .h file, but not its corresponding stdafx.h - because I have my own.)
I don't understand why it would compile in Debug but not in Release.
fatal error C1083: Cannot open include file: 'stdafx.h': No such file or directory
The #include "stdafx.h" that this error refers to is from a file that was developed outside my project (ie. I added the .cpp and .h file, but not its corresponding stdafx.h - because I have my own.)
I don't understand why it would compile in Debug but not in Release.
Under your project settings, check whether your Debug and Release configurations are different in "Additional Include Directories" and make sure that these entries are the same (if applicable).
ASKER
Yup I checked that, they're exactly the same :(
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Is it possible that someone disabled "Precompiled headers" in debug mode?, but not in "Release" mode?
ASKER
All the settings for the project seem to be the same for Debug and Release.
I have now noticed, however, that I only get the error if I try to "Build" the solution but if I click "Start" (debugging), it asks me if I want to build the solution (as it is not up to date), I click Yes, and it builds and runs ok.
Can anyone explain to me why this is so? I am fairly new to this and am getting a serious "crash course" (literally! lol).
Thanks
I have now noticed, however, that I only get the error if I try to "Build" the solution but if I click "Start" (debugging), it asks me if I want to build the solution (as it is not up to date), I click Yes, and it builds and runs ok.
Can anyone explain to me why this is so? I am fairly new to this and am getting a serious "crash course" (literally! lol).
Thanks