[cfe-dev] Precompiled headers

Russell Wallace via cfe-dev cfe-dev at lists.llvm.org
Fri Dec 11 10:49:01 PST 2015


-Xclang twice sort of works, but it seems to make the compiler forget how
to call the linker?

C:\test>clang-cl -fms-compatibility-version=19 -Xclang -include-pch -Xclang
a.h.gch a.cpp
a-427777.obj : error LNK2019: unresolved external symbol "class
std::basic_ostream<char,struct std::char_traits<char> > std::cout"
(?cout at std@@3V?$basic_ostream at DU?$char_traits at D@std@@@1 at A) referenced in
function main
a-427777.obj : error LNK2019: unresolved external symbol "bool __cdecl
std::uncaught_exception(void)" (?uncaught_exception at std@@YA_NXZ) referenced
in function "public: __cdecl std::basic_ostream<char,struct
std::char_traits<char> >::sentry::~sentry(void)" (??1sentry@
?$basic_ostream at DU?$char_traits at D@std@@@std@@QEAA at XZ)
a-427777.obj : error LNK2019: unresolved external symbol "char const *
__cdecl std::_Syserror_map(int)" (?_Syserror_map at std@@YAPEBDH at 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 at std@@UEBA?AV?$basic_string at DU?$char_traits at D@std@
@V?$allocator at D@2@@2 at H@Z)
a-427777.obj : error LNK2019: unresolved external symbol "void __cdecl
std::_Xout_of_range(char const *)" (?_Xout_of_range at std@@YAXPEBD at 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 at DU?$char_traits at D@std@@V?$allocator at D@2@@std@
@QEBAXXZ)
a-427777.obj : error LNK2019: unresolved external symbol "void __cdecl
std::_Xlength_error(char const *)" (?_Xlength_error at std@@YAXPEBD at 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 at DU?$char_traits at D@std@@V?$allocator at D@2@@std@
@QEBAXXZ)
a-427777.obj : error LNK2019: unresolved external symbol "void __cdecl
std::_Xbad_alloc(void)" (?_Xbad_alloc at std@@YAXXZ) referenced in function
"char * __cdecl std::_Allocate<char>(unsigned __int64,char *,bool)"
(??$_Allocate at D@std@@YAPEAD_KPEAD_N at Z)
a.exe : fatal error LNK1120: 6 unresolved externals


On Fri, Dec 11, 2015 at 6:42 PM, Reid Kleckner <rnk at google.com> wrote:

> 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.
>

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?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20151211/9ef0fd9c/attachment.html>


More information about the cfe-dev mailing list