I've managed to compile LLVM & Clang on windows using command prompt and using it in MinGW (MSYS Shell). I've done this multiple times, following many different instructions, ranging from the Getting started page for clang, the <a href="http://llvm.org">llvm.org</a> official getting started page, and even the attached guide written by someone else on the llvmdev email list (<a href="http://lists.cs.uiuc.edu/pipermail/cfe-dev/2012-June/022242.html">http://lists.cs.uiuc.edu/pipermail/cfe-dev/2012-June/022242.html</a>). LLVM always finishes compiling, albeit with some warnings. However whenever I try to compile the Kaleidoscope Chapter 7 code with the proposed instructions, it always fails with the bottom error messages.<div>
<div>I've tried this on Windows XP, Windows 7, and Windows 8 (Release Preview), always the same messages.</div><div><br></div><div><font class="Apple-style-span" face="Times" size="3"><span class="Apple-style-span" style><div>
Error message:</div><div>$ clang++ -g -O3 toy.cpp `llvm-config --cppflags --ldflags --libs core jit nati</div><div>ve` -o toy</div><div>c:/llvm/llvminstall/lib/libLLVMCore.a(Instructions.cpp.obj): duplicate section `</div>
<div>.rdata$_ZTSN4llvm10ilist_nodeINS_11InstructionEEE[typeinfo name for llvm::ilist_</div><div>node<llvm::Instruction>]' has different size</div><div>c:/llvm/llvminstall/lib/libLLVMCore.a(Instructions.cpp.obj): duplicate section `</div>
<div>.rdata$_ZTIN4llvm10ilist_nodeINS_11InstructionEEE[typeinfo for llvm::ilist_node<</div><div>llvm::Instruction>]' has different size</div><div>c:/llvm/llvminstall/lib/libLLVMCore.a(Instructions.cpp.obj): duplicate section `</div>
<div>.rdata$_ZTSN4llvm15ilist_half_nodeINS_11InstructionEEE[typeinfo name for llvm::i</div><div>list_half_node<llvm::Instruction>]' has different size</div><div>c:/llvm/llvminstall/lib/libLLVMCore.a(Instruction.cpp.obj): duplicate section `.</div>
<div>rdata$_ZTSN4llvm10ilist_nodeINS_11InstructionEEE[typeinfo name for llvm::ilist_n</div><div>ode<llvm::Instruction>]' has different size</div><div>c:/llvm/llvminstall/lib/libLLVMCore.a(Instruction.cpp.obj): duplicate section `.</div>
<div>rdata$_ZTIN4llvm10ilist_nodeINS_11InstructionEEE[typeinfo for llvm::ilist_node<l</div><div>lvm::Instruction>]' has different size</div><div>c:/llvm/llvminstall/lib/libLLVMCore.a(Instruction.cpp.obj): duplicate section `.</div>
<div>rdata$_ZTSN4llvm15ilist_half_nodeINS_11InstructionEEE[typeinfo name for llvm::il</div><div>ist_half_node<llvm::Instruction>]' has different size</div><div>c:/llvm/llvminstall/lib/libLLVMSupport.a(DynamicLibrary.cpp.obj):DynamicLibrary.</div>
<div>cpp:(.text+0x2be): undefined reference to `__imp__EnumerateLoadedModules@12'</div><div>c:/llvm/llvminstall/lib/libLLVMSupport.a(Signals.cpp.obj):Signals.cpp:(.text+0x5</div><div>9e): undefined reference to `__imp__SymSetOptions@4'</div>
<div>c:/llvm/llvminstall/lib/libLLVMSupport.a(Signals.cpp.obj):Signals.cpp:(.text+0x5</div><div>be): undefined reference to `__imp__SymInitialize@12'</div><div>c:/llvm/llvminstall/lib/libLLVMSupport.a(Process.cpp.obj):Process.cpp:(.text+0xc</div>
<div>4): undefined reference to `_GetProcessMemoryInfo@12'</div><div>collect2.exe: error: ld returned 1 exit status</div><div>clang++: error: linker (via gcc) command failed with exit code 1 (use -v to see</div><div>
invocation)</div>
</span></font><span class="Apple-style-span" style="color:rgb(34,34,34);font-family:arial,sans-serif;line-height:16px"><div><span class="Apple-style-span" style="color:rgb(34,34,34);font-family:arial,sans-serif;line-height:16px"><br>
</span></div><br></span><span class="Apple-style-span" style="font-family:Times;font-size:medium">On a side note does anyone know how to fix the LLVM external function error (</span><span class="Apple-style-span" style="color:rgb(34,34,34);font-family:arial,sans-serif;line-height:16px">Program used <em style="font-weight:bold;font-style:normal;color:rgb(0,0,0)">external function</em> '...' which could not be resolved!) in Cygwin? At the moment Cygwin with its prebuilt llvm/clang binaries is the only fully functioning version of LLVM that i have, it compiles and runs kaleidoscope fine other than with the external function error.</span></div>
<div><font class="Apple-style-span" color="#222222" face="arial, sans-serif"><span class="Apple-style-span" style="line-height:16px"><br></span></font></div><div><font class="Apple-style-span" color="#222222" face="arial, sans-serif"><span class="Apple-style-span" style="line-height:16px"><br>
</span></font><font class="Apple-style-span" face="Times" size="3"><span class="Apple-style-span" style><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div>
<div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></span></font></div></div>