Clang++ can't seem to build a simple hello world program on windows.

C:\Users\alex\Desktop>clang++ -nostdinc -I C:\MinGW\lib\gcc\mingw32\4.4.0\inclu
e\c++ hello.cpp
In file included from hello.cpp:2:
C:\MinGW\lib\gcc\mingw32\4.4.0\include\c++/iostream:38:10: fatal error:
‘bits/c++config.h’ file not found
#include <bits/c++config.h>
^
Assertion failed: TemplateTypeParm->getDepth() == 0 && "Can’t deduce with depth

0", file C:\Users\alex\Desktop\llvm\tools\clang\lib\Sema\SemaTemplateDeductio
.cpp, line 436

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application’s support team for more information.
clang++: error: clang frontend command failed with exit code 3 (use -v to see i
vocation)

Am I doing something wrong?

The assertion is unfortunate, but the basic problem is that Clang can’t find all of the mingw headers. Look at where <bits/c++config.h> resides, and make sure to add an -I for that location to your command line.

  • Doug