At my work, I saw bunch of other projects doing PRECOMPILED_CXX=1 in their corresponding source configuration files.
I searched on MSDN, and it gave me the following information.
I have a program written in C++, but I forgot to put the PRECOMPILED_CXX=1 in the build settings, but it compiled fine, and then worked fine. So what exactly is the reason why we should set this macro when building C++ project?This macro definition indicates whether the associated precompiled header will be used with files written in C or C++.
Another interesting thing I noticed. When I don't set the macro, the compiler won't complain when I only include pch.h in .h files and not in their corresponding .cpp files. But it will complain as expected when I set the macro. Does it have to do with C vs C++ pre-compiled header usage? I am just beginning to learn C/C++ build settings, so any help would be appreicated!Code:# My source configuration file ... PRECOMPILED_INCLUDE=pch.h ...