[cfe-dev] Running clang on Windows with mingw

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


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

int main()
	std::cout<<"Hello world!\n";

The output is:
C:/Windows/TEMP/cc-000001.o:fake:(.text+0x14): undefined reference to
C:/Windows/TEMP/cc-000001.o:fake:(.text+0x3e): undefined reference to
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?



More information about the cfe-dev mailing list