<div dir="ltr">I'm trying to use Clang on Windows to compile C++ to bitcode and then to an executable (with a view to carrying out some experiments on whole program optimization of the bitcode).<div><br></div><div>When I use clang.exe, even with -D_HAS_EXCEPTIONS=0 -fms-compatibility -fms-extensions, I get errors:</div><div><br></div><div><div>main-621e97.o : error LNK2019: unresolved external symbol _Unwind_Resume referenced in function main</div><div>main-621e97.o : error LNK2001: unresolved external symbol __gxx_personality_v0</div><div>main-621e97.o : error LNK2019: unresolved external symbol __cxa_call_unexpected referenced in function "public: class std::_Vector_iterator<class std::_Vector_val<struct std::_Simple_types<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > > __cdecl std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >::begin(void)" (?begin@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QEAA?AV?$_Vector_iterator@V?$_Vector_val@U?$_Simple_types@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@@std@@@2@XZ)</div><div>a.out : fatal error LNK1120: 3 unresolved externals</div></div><div><br></div><div>clang-cl.exe avoids those errors and can generate an executable from C++, but it doesn't seem to have -emit-llvm or an equivalent option.</div><div><br></div><div>What am I missing?</div></div>