<div dir="ltr">-Xclang twice sort of works, but it seems to make the compiler forget how to call the linker?<br><br>C:\test>clang-cl -fms-compatibility-version=19 -Xclang -include-pch -Xclang a.h.gch a.cpp <br>a-427777.obj : error LNK2019: unresolved external symbol "class std::basic_ostream<char,struct std::char_traits<char> > std::cout" (?cout@std@@3V?$basic_ostream@DU?$char_traits@D@std@@@1@A) referenced in function main<br>a-427777.obj : error LNK2019: unresolved external symbol "bool __cdecl std::uncaught_exception(void)" (?uncaught_exception@std@@YA_NXZ) referenced in function "public: __cdecl std::basic_ostream<char,struct std::char_traits<char> >::sentry::~sentry(void)" (??1sentry@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAA@XZ)<br>a-427777.obj : error LNK2019: unresolved external symbol "char const * __cdecl std::_Syserror_map(int)" (?_Syserror_map@std@@YAPEBDH@Z) referenced in function "public: virtual class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl std::_Generic_error_category::message(int)const " (?message@_Generic_error_category@std@@UEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@H@Z)<br>a-427777.obj : error LNK2019: unresolved external symbol "void __cdecl std::_Xout_of_range(char const *)" (?_Xout_of_range@std@@YAXPEBD@Z) referenced in function "public: void __cdecl std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::_Xran(void)const " (?_Xran@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBAXXZ)<br>a-427777.obj : error LNK2019: unresolved external symbol "void __cdecl std::_Xlength_error(char const *)" (?_Xlength_error@std@@YAXPEBD@Z) referenced in function "public: void __cdecl std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::_Xlen(void)const " (?_Xlen@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBAXXZ)<br>a-427777.obj : error LNK2019: unresolved external symbol "void __cdecl std::_Xbad_alloc(void)" (?_Xbad_alloc@std@@YAXXZ) referenced in function "char * __cdecl std::_Allocate<char>(unsigned __int64,char *,bool)" (??$_Allocate@D@std@@YAPEAD_KPEAD_N@Z)<br>a.exe : fatal error LNK1120: 6 unresolved externals<br><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 11, 2015 at 6:42 PM, Reid Kleckner <span dir="ltr"><<a href="mailto:rnk@google.com" target="_blank">rnk@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class=""></span>Nico was going to take a shot at making the /Y preprocessor flags work with clang-cl, but I don't think he got around to it. I think it's not as easy as adding more aliases, you have to add some driver logic. <br></div></div></div>
</blockquote></div><br>Yes, it gives me a warning of unused option. The part about having to add some driver logic might be related to the above problem with the compiler forgetting how to call the linker?<br></div></div>