Hi all,<div> I am new for clang and llvm and this mailing forum. I am trying build cland on my windows xp 32 bit system using "cland binaries for mingw32 version 2.9" and "llvm binaries for mingw32 version 2.9". I follow following steps:</div>
<div><br></div><div>1. download mingw in directory (C:/MinGW)</div><div>2. download "clang2.9 binaries for mingw32" and "llvm-2.9 binaries for mingw32"</div><div>3. extract both in the same directory of mingw (C:/MinGW)</div>
<div>4. set path C:/MinGW/bin to PATH environment.</div><div>Then I write one simple code</div><div> #include<stdio.h></div><div> int main()</div><div> {</div><div> printf("hello world\n");</div><div>
return 0;</div><div> }</div><div><br></div><div>then compile code</div><div> clang hello.cpp -o hello.exe</div><div>it compiles fine</div><div>but when I tried to execute it</div><div> clang hello.exe</div><div>it gives following error</div>
<div><br></div><div>*****************************ERROR*****************************</div><div><div>hello.exe:crt1.c:(.text+0x280): multiple definition of `mainCRTStartup'</div><div>c:/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../crt2.o:crt1.c:(.text+0x280): firs</div>
<div>t defined here</div><div>hello.exe:crt1.c:(.text+0x2a0): multiple definition of `WinMainCRTStartup'</div><div>c:/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../crt2.o:crt1.c:(.text+0x2a0): firs</div><div>t defined here</div>
<div>hello.exe:crt1.c:(.text+0x2c0): multiple definition of `atexit'</div><div>c:/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../crt2.o:crt1.c:(.text+0x2c0): firs</div><div>t defined here</div><div>hello.exe:crt1.c:(.text+0x2d0): multiple definition of `_onexit'</div>
<div>c:/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../crt2.o:crt1.c:(.text+0x2d0): firs</div><div>t defined here</div><div>hello.exe:cygming-crtbegin.c:(.text+0x2e0): multiple definition of `__gcc_regist</div><div>er_frame'</div>
<div>c:/mingw/bin/../lib/gcc/mingw32/4.6.2/crtbegin.o:cygming-crtbegin.c:(.text+0x0):</div><div> first defined here</div><div>hello.exe:cygming-crtbegin.c:(.text+0x36c): multiple definition of `__gcc_deregi</div><div>ster_frame'</div>
<div>c:/mingw/bin/../lib/gcc/mingw32/4.6.2/crtbegin.o:cygming-crtbegin.c:(.text+0x8c)</div><div>: first defined here</div><div>hello.exe:crt1.c:(.bss+0x4): multiple definition of `_argc'</div><div>c:/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../crt2.o:crt1.c:(.bss+0x4): first d</div>
<div>efined here</div><div>hello.exe:crt1.c:(.bss+0x0): multiple definition of `_argv'</div><div>c:/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../crt2.o:crt1.c:(.bss+0x0): first d</div><div>efined here</div><div>c:/mingw/bin/../lib/gcc/mingw32/4.6.2/crtbegin.o:cygming-crtbegin.c:(.text+0x85)</div>
<div>: undefined reference to `_Jv_RegisterClasses'</div><div>collect2: ld returned 1 exit status</div><div>clang: error:</div><div> linker</div><div> (via</div><div> gcc)</div><div> command</div><div>
failed</div><div> with</div><div> exit</div><div> code</div><div> 1</div><div> (use</div><div> -v</div><div> to</div><div> see</div><div> invocation)</div></div><div>*****************************************************]</div>
<div>How can I resolve this problem?</div><div><br></div><div><br></div>