<div class="gmail_extra">I have been using MinGW to linking the output from clang successfully... I did find that getting it to work correctly was a little tricky, in particular, when passing object files to ld, the order is very important. Specifically, you must pass crt initialization files first.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">I use the following line to link a simple one file C++ program, %MWL% and %GCL% are paths into the MinGW library directories.</div><div class="gmail_extra"><br></div>
<div class="gmail_extra">ld -L %GCL% --subsystem console %MWL%crt2.o %GCL%crtbegin.o test-c-clang.o -lmingw32 -lgcc_eh -lgcc -lmsvcrt -lkernel32 %GCL%crtend.o</div><div class="gmail_extra"><br></div><div class="gmail_extra">
This requires only using clang to compile the file to an object file using the -c option, and the -o <object-file-name> option.<br><br>I don't think clang is compatible with Visual C++'s standard library (with regards to compiler generated library calls)<br>
<br><div class="gmail_quote">On Tue, Apr 24, 2012 at 4:44 PM, Paul J. Lucas <span dir="ltr"><<a href="mailto:paul@lucasmail.org" target="_blank">paul@lucasmail.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I followed the build instructions for LLVM+clang -- that all went OK.  But compiling a simple "hello world" program with clang++ gives a linker error -- see attached log file.<br>
<span class="HOEnZb"><font color="#888888"><br>
- Paul<br>
<br>
</font></span><br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><br></div>