<span style>Hi all,</span><div style> 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 style><br></div><div style>1. download mingw in directory (C:/MinGW)</div><div style>2. download "clang2.9 binaries for mingw32" and "llvm-2.9 binaries for mingw32"</div><div style>3. extract both in the same directory of mingw (C:/MinGW)</div>
<div style>4. set path C:/MinGW/bin to PATH environment.</div><div style>Then I write one simple code</div><div style> #include<stdio.h></div><div style> int main()</div><div style> {</div><div style> printf("hello world\n");</div>
<div style> return 0;</div><div style> }</div><div style><br></div><div style>then compile code</div><div style> clang hello.cpp -o hello.exe</div><div style>it compiles fine</div><div style>but when I tried to execute it</div>
<div style> clang hello.exe</div><div style>it gives following error</div><div style><br></div><div style>*****************************ERROR*****************************</div><div style><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 style>*****************************************************]</div><div style>How can I resolve this problem?</div>