[cfe-dev] Running clang on Windows with mingw

Eric Niebler eric at boostpro.com
Sat Jul 10 23:07:42 PDT 2010


On 7/11/2010 1:45 AM, Yun Chen wrote:
> Hi
> 
> If I compile the following code with command line: clang++ -Xclang
> -triple=i686-pc-mingw32 -isystem
> C:\MinGW\lib\gcc\mingw32\4.4.0\include\c++\mingw32 t.cpp
> 
> #include<iostream>
> int main()
> {
> 	std::cout<<"Hello world!\n";
> }
> 
> The output is:
> C:/Windows/TEMP/cc-000001.o:fake:(.text+0x14): undefined reference to
> `__dso_handle'
> C:/Windows/TEMP/cc-000001.o:fake:(.text+0x3e): undefined reference to
> `__cxa_atexit'
> collect2: ld returned 1 exit status
> clang++: error: linker (via gcc) command failed with exit code 1 (use
> -v to see invocation)
> 
> How can I get rid of the link errors?

This is a known bug: http://llvm.org/bugs/show_bug.cgi?id=7276

Dear clang team: there are hoards of Windows users out here who want to
help make clang great. Be a sport and throw us a bone. :-)

-- 
Eric Niebler
BoostPro Computing
http://www.boostpro.com



More information about the cfe-dev mailing list