I checkout LLVM and clang from SVN, then use CMake to generate project files for Visual Studio 2010 (I started with 2008). The LLVM project compiles successfully and gives me all the tools including Clang. For a few tests, I compile C++ code with Clang which if I need to I link, I use MinGW's ld passing all the relevant object files and libraries including correctly ordering the start-up code and such. <div>
<br></div><div>My project is C++ language front end using a CMake build script to generate a Visual Studio 2010 project. Within the CMake build script I specify each individual library I need to link against in the correct order.</div>
<div><br></div><div>LLVM is written in C++ so it is the de facto interface.
>From what I understand the C bindings are not complete, but they are quite usable.<br><br>this is the library section of my CMake build script for the final executable:<br><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>${PLATFORM_LIBS}</div>
<div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>#LLVMX86Disassembler</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>#LLVMX86AsmParser</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>LLVMX86AsmPrinter</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>LLVMX86CodeGen</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>LLVMX86Utils</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>LLVMX86Desc</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>LLVMX86Info</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>LLVMSelectionDAG</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>LLVMAsmPrinter</div>
<div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>#LLVMJIT</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>#LLVMExecutionEngine</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>LLVMCodeGen</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>LLVMScalarOpts</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>LLVMTransformUtils</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>#LLVMipa</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>LLVMAnalysis</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>LLVMTarget</div><div><span class="Apple-tab-span" style="white-space:pre"> </span></div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>LLVMMCParser</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>LLVMMC</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>LLVMCore</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>LLVMSupport</div><div><br></div><div>It took me a little while to get the ordering right the first time, but it has been pretty stable since then.</div><div>
<br></div><div class="gmail_quote">On Fri, May 25, 2012 at 6:24 AM, Mikael Lyngvig <span dir="ltr"><<a href="mailto:mikael@lyngvig.org" target="_blank">mikael@lyngvig.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
So you are using Visual Studio?! I tried that path but ran into all sorts of problems with unresolved symbols, when linking C++ code, even though I experimentally linked in each and every LLVM library. I would be very interested in hearing how you manage to use VS. Are you using the VS libraries for a project of your own or are you only using them for working on LLVM/Clang? Also, what language are you using: C or C++? I understood from the mailing list that the C++ support is not mature enough for it to be used succesfully.<div>
<br></div><div>By the way, that shell script (llvm-config) is now a program (.exe) so it is easy to use also on Windows. </div></blockquote><div> </div><div><snip></div></div></div>