I do not think this is unique to my projects, it applies to any C++ library that uses precompiled headers and a project that uses the library that has its own precompiled headers. Its just that C++/winRt headers are SOOO time consuming you really need to precompile those.
I have a C++/winRT UWP library. Since it uses windows runtime APIs it 'needs' to precompile those massive header files. I call that file 'btwrpch.h' since it contains mostly Bluetooth runtime APIs. The library build fine.
Now this library is to be used in another C++/winRT UWP project which also uses windows runtimes, mostly UI stuff. The precompiled headers for this project use the classic pch.h.
To use the library, the project has the library header files including btwrpch.h. The project has its own pch.h file.
I cannot figure out how to create the precompiled headers for both.
In the project I placed the btwrpch.cpp file and the pch.cpp file. I configured each of these cpp files to generate precompiled headers.
In the project properties precompiled header option I have two files, pch.h;btwrpch.h and two output files $(IntDir)pch.pch; $(IntDir)btwrpch.pch;
Yet when I rebuild the project I get the error
fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "pch.h; btwrpch.h"' to your source?
I have one source file (in addition to the header.cpp files) called app.cpp and the two headers are included. Looking in the Debug directory, I see both pch.pch and btwrpch.pch.
What am I doing wrong?
Note if I merge the btwrpch.h file into pch.h and define only one precompiled header, it works fine. I do not want a library user to have to do that.