<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div><br>clang++.exe defaults to targeting gcc's ABI. Either set it to target msvc (e.g., '-target i686-pc-windows-msvc') or use clang-cl.exe.</div><div><br>On Nov 21, 2014, at 2:07 AM, Dongsheng Song <<a href="mailto:dongsheng.song@gmail.com">dongsheng.song@gmail.com</a>> wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Nov 21, 2014 at 2:11 AM, 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">Currently I don't think we have a solid preferred choice for a Windows standard C++ library to use with Clang. There are only tradeoffs and options:<div><br></div><div>MSVC's STL: The 2013 version should work out of the box right now, but exceptions don't work and you have to disable them with -D_HAS_EXCEPTIONS=0. This option is good if you want to link against other C++ code built with MSVC. I care about this config, so if you hit snags I'd like to know. There is a known issue with the C++11 threading headers and -D_HAS_EXCEPTIONS=0, which is described in this file in LLDB:</div><div><a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/test/make/uncaught_exception.h?view=markup" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/test/make/uncaught_exception.h?view=markup</a><br></div><br></div><br></blockquote><div><br></div><div>Not works for me (clang 3.5 and VS 2013 U4):<br><br>clang++ -D_HAS_EXCEPTIONS=0 hello.cpp<br>hello-d5bfe1.o : error LNK2019: unresolved external symbol _Unwind_Resume referenced in function "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<<struct std::char_traits<char> >(class std::basic_ostream<char,struct std::char_traits<char> > &,char const *)" (??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@PEBD@Z)<br>hello-d5bfe1.o : error LNK2001: unresolved external symbol __gxx_personality_v0<br>hello-d5bfe1.o : error LNK2019: unresolved external symbol __cxa_call_unexpected 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.out : fatal error LNK1120: 3 unresolved externals<br>clang++.exe: error: linker command failed with exit code 1120 (use -v to see invocation)<br><br></div></div></div></div>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>cfe-dev mailing list</span><br><span><a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a></span><br><span><a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a></span><br></div></blockquote></body></html>