[cfe-dev] Running clang on Windows with mingw

Yun Chen yun.go.chen at gmail.com
Sat Jul 10 22:45:29 PDT 2010


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?

Thanks!

Yun



More information about the cfe-dev mailing list