How to use STL with clang++?


Thanks for your reply. I have tried to use STL header of tdm gcc 4.5.1, I don’t have gcc 4.2.0 currently, in Mingw and link with ld. The normal STL string, vector, list etc work well. However a simple test case which is pasted below with iostream still can not work. The ld will report can not find external function _dso_handle and _cxa_atexit. I have used -E option to find where it comes from. It seems LLVM compiler generate them. Some libraries are missed I guess. Could you help me check it? Or could you help paste the compiler verbose output with -v? Or I have to use gcc 4.2.x?

By the way, which linker is recommended to use on Windows? MingW GNU ld or MSVC link? My LLVM is built with VS2005.


using namespace std;
int main()
string str=“test”;
cout << str;