<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body bgcolor="#ffffff" text="#000000">
I've successfully build Clang compiler on Windows and successfully
compiled a simple pure C hello world application. But when I've
tried to compile the following simple C++ application I got a bunch
of linking errors from Visual Studio 2010 linker.<br>
<br>
The content of "sample.cpp":<br>
<blockquote>#include <vector><br>
<br>
int main() {<br>
std::vector<int> v;<br>
v.push_back( 0 );<br>
return v.front();<br>
}<br>
<br>
</blockquote>
Then I've typed in the Visual Studio 2010 command line:<br>
<blockquote>clang sample.cpp -o sample.exe -v<br>
<br>
</blockquote>
And I've got this:<br>
<blockquote>clang version 3.0 (trunk)<br>
Target: i686-pc-win32<br>
Thread model: posix<br>
"C:/Development/Clang/build/bin/Release/clang.exe" -cc1 -triple
i686-pc-win32 -<br>
emit-obj -mrelax-all -disable-free -disable-llvm-verifier
-main-file-name sample<br>
.cpp -mrelocation-model static -mdisable-fp-elim -masm-verbose
-mconstructor-ali<br>
ases -momit-leaf-frame-pointer -v -resource-dir
C:/Development/Clang/build/bin/R<br>
elease\..\lib\clang\3.0 -ferror-limit 19 -fmessage-length 80
-fcxx-exceptions -f<br>
exceptions -fms-extensions -fmsc-version=1300 -fgnu-runtime
-fdiagnostics-show-o<br>
ption -fcolor-diagnostics -o
C:/DOCUME~1/Lokken/LOCALS~1/Temp/cc-633218.o -x c++<br>
sample.cpp<br>
clang -cc1 version 3.0 based upon llvm 3.0 hosted on i686-pc-win32<br>
ignoring nonexistent directory "/usr/local/include"<br>
ignoring nonexistent directory
"C:/Development/Clang/build/bin/Release/../lib/cl<br>
ang/3.0/include"<br>
ignoring nonexistent directory "C:\Program Files\Microsoft Visual
Studio 10.0\VC<br>
\PlatformSDK\Include"<br>
ignoring nonexistent directory "/usr/include"<br>
#include "..." search starts here:<br>
#include <...> search starts here:<br>
C:\Program Files\Microsoft Visual Studio 10.0\VC\include<br>
End of search list.<br>
"C:/Program Files/Microsoft Visual Studio 10.0/VC/BIN/link.exe"
-out:sample.exe<br>
-defaultlib:libcmt -nologo
C:/DOCUME~1/Lokken/LOCALS~1/Temp/cc-633218.o<br>
cc-633218.o : error LNK2019: unresolved external symbol
__ZSt14_Xlength_errorPKc<br>
referenced in function __ZNKSt6vectorIiSaIiEE5_XlenEv<br>
cc-633218.o : error LNK2019: unresolved external symbol __ZdlPv
referenced in fu<br>
nction __ZNSaIiE10deallocateEPij<br>
cc-633218.o : error LNK2019: unresolved external symbol __Znwj
referenced in fun<br>
ction __ZSt9_AllocateIiEPT_jS1_<br>
cc-633218.o : error LNK2019: unresolved external symbol
___cxa_allocate_exceptio<br>
n referenced in function __ZSt9_AllocateIiEPT_jS1_<br>
cc-633218.o : error LNK2019: unresolved external symbol
___cxa_throw referenced<br>
in function __ZSt9_AllocateIiEPT_jS1_<br>
cc-633218.o : error LNK2019: unresolved external symbol
__ZNSt9exceptionD2Ev ref<br>
erenced in function __ZNSt9bad_allocD2Ev<br>
cc-633218.o : error LNK2019: unresolved external symbol
__ZNSt9exceptionC2ERKPKc<br>
referenced in function __ZNSt9bad_allocC2EPKc<br>
cc-633218.o : error LNK2001: unresolved external symbol
__ZTVN10__cxxabiv120__si<br>
_class_type_infoE<br>
cc-633218.o : error LNK2001: unresolved external symbol
__ZTISt9exception<br>
cc-633218.o : error LNK2001: unresolved external symbol
__ZNKSt9exception4whatEv<br>
<br>
</blockquote>
Is this a bug or am I doing something wrong?<br>
</body>
</html>