LLVM Kaleidoscope Chapter 7 Compilation Error in MinGW32(MSYS Shell) on Windows

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 llvm.org official getting started page, and even the attached guide written by someone else on the llvmdev email list (http://lists.cs.uiuc.edu/pipermail/cfe-dev/2012-June/022242.html). 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.

I’ve tried this on Windows XP, Windows 7, and Windows 8 (Release Preview), always the same messages.

Error message:
$ clang++ -g -O3 toy.cpp llvm-config --cppflags --ldflags --libs core jit nati ve -o toy
c:/llvm/llvminstall/lib/libLLVMCore.a(Instructions.cpp.obj): duplicate section .rdata$_ZTSN4llvm10ilist_nodeINS_11InstructionEEE[typeinfo name for llvm::ilist_ node<llvm::Instruction>]' has different size c:/llvm/llvminstall/lib/libLLVMCore.a(Instructions.cpp.obj): duplicate section
.rdata$_ZTIN4llvm10ilist_nodeINS_11InstructionEEE[typeinfo for llvm::ilist_node<
llvm::Instruction>]’ has different size
c:/llvm/llvminstall/lib/libLLVMCore.a(Instructions.cpp.obj): duplicate section .rdata$_ZTSN4llvm15ilist_half_nodeINS_11InstructionEEE[typeinfo name for llvm::i list_half_node<llvm::Instruction>]' has different size c:/llvm/llvminstall/lib/libLLVMCore.a(Instruction.cpp.obj): duplicate section.
rdata$_ZTSN4llvm10ilist_nodeINS_11InstructionEEE[typeinfo name for llvm::ilist_n
odellvm::Instruction]’ has different size
c:/llvm/llvminstall/lib/libLLVMCore.a(Instruction.cpp.obj): duplicate section . rdata$_ZTIN4llvm10ilist_nodeINS_11InstructionEEE[typeinfo for llvm::ilist_node<l lvm::Instruction>]' has different size c:/llvm/llvminstall/lib/libLLVMCore.a(Instruction.cpp.obj): duplicate section .
rdata$_ZTSN4llvm15ilist_half_nodeINS_11InstructionEEE[typeinfo name for llvm::il
ist_half_nodellvm::Instruction]’ has different size
c:/llvm/llvminstall/lib/libLLVMSupport.a(DynamicLibrary.cpp.obj):DynamicLibrary.
cpp:(.text+0x2be): undefined reference to __imp__EnumerateLoadedModules@12' c:/llvm/llvminstall/lib/libLLVMSupport.a(Signals.cpp.obj):Signals.cpp:(.text+0x5 9e): undefined reference to __imp__SymSetOptions@4’
c:/llvm/llvminstall/lib/libLLVMSupport.a(Signals.cpp.obj):Signals.cpp:(.text+0x5
be): undefined reference to __imp__SymInitialize@12' c:/llvm/llvminstall/lib/libLLVMSupport.a(Process.cpp.obj):Process.cpp:(.text+0xc 4): undefined reference to _GetProcessMemoryInfo@12’
collect2.exe: error: ld returned 1 exit status
clang++: error: linker (via gcc) command failed with exit code 1 (use -v to see
invocation)

On a side note does anyone know how to fix the LLVM external function error (Program used external function ‘…’ 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.