I am using pre-compiled headers in my project in C but we are integrating a .CPP file into the project.
Here's the error:
Error 1 fatal error C1853: 'Debug\MuffinFactory.pch' precompiled header file is from a previous version of the compiler, or the precompiled header is C++ and you are using it from C (or vice versa) c:\users\blake\desktop\projects\muffinfactory\source\main.cpp 1
We only need a single .CPP compiled in our project, but we really need the pre-compiled header to save compile times (Windows.h and more).
How should I organize my project to do this?
Usage of precompiled headers may significantly reduce compilation time, especially when applied to large header files, header files that include many other header files, or header files that are included in many translation units.
The compiler options for precompiled headers are /Y . In the project property pages, the options are located under Configuration Properties > C/C++ > Precompiled Headers. You can choose to not use precompiled headers, and you can specify the header file name and the name and path of the output file.
Header files serve two purposes. System header files declare the interfaces to parts of the operating system. You include them in your program to supply the definitions and declarations you need to invoke system calls and libraries.
So don't use precompiled headers for that single file!
Being a .cpp file, it will have separate compilation options anyway.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With