In my program I have 3 files right now. main.cpp, DirectXTemplatePCH.h, DirectXTemplatePCH.cpp The only line in DirectXTemplatePCH.cpp file is the include for the header. I have gone into the properties and with All Configurations selected Configuration Properties > C/C++ > Precompiled Headers the Precompiled Header option is set to Use(/Yu), and the Precomiled Header File is DirectXTemplatePCH.h. Then Under just the DirectXTemplatePCH.cpp file the PreCompiled Header is set to Create(/Yc). This should be all that I need to do, but whatever I try to do it keeps giving me an error saying "fatal error C1003: Cannot open include file: 'DirectXTemplatePCH.h': No such file or directory". All the .cpp and .h files are in the same folder.
Asked
Active
Viewed 555 times
0
-
a typo somewhere? Try copy-pasting filenames from explorer it always helps =) – Ivan Aksamentov - Drop Jan 06 '15 at 02:56
-
I've checked it many times for a typo. I have been known to make them, but I don't think this is the cause this time. – Desenski Jan 06 '15 at 03:03
-
@Desenski Would it be possible to just use the /FI switch and have the compiler force the include for you, as described here: http://stackoverflow.com/a/26782526/2642059 – Jonathan Mee Jan 06 '15 at 03:39
-
BTW< are you using ``#include "DirectXTemplatePCH.h"`` or are you using ``#include
`` – Chuck Walbourn Jan 06 '15 at 05:06 -
I am using <>. Should I be using "" instead? – Desenski Jan 06 '15 at 05:48
-
1I'm not sure, but try it. You typically use <> for headers that are part of the INLCUDE search path, and then use "" for local headers. – Chuck Walbourn Jan 06 '15 at 19:08
-
Wow, I didn't know what the difference was between the two, but that does indeed fix it. Thank you, I don't think I would have ever figured that out on my own. – Desenski Jan 06 '15 at 23:42