[cfe-dev] cannot use libc++ with mingw-64

ownssh ownsshaim at aol.com
Sun Jul 27 09:28:16 PDT 2014


Hello, I can't use libc++ with mingw-64 so I came here seeking help.
mingw64 version is i686-4.9.1-release-posix-dwarf-rt_v3-rev0

Fist I compile with "clang++ -stdlib=libc++ 1.cpp"
the error is "gcc.exe: error: unrecognized command line option 
'-stdlib=c++'"
so I can't use libc++ anyway from clang++.

Then I compile with "clang -m32 -lc++ -lsupc++ -lpthread -lgcc_s -lgcc 
-lmsvcr100 -ladvapi32 -lshell32 -luser32 -lkernel32 -lmsvcrt 1.cpp",
It's ok when the program not use exception or new.
If used, the error is
"C:/LLVM/include/c++/v1/new:154: undefined reference to `operator 
new(unsigned in
t)'
C:/LLVM/include/c++/v1/string:1212: undefined reference to 
`__cxa_allocate_excep
tion'
C:/LLVM/include/c++/v1/string:1216: undefined reference to `__cxa_throw'
C:/LLVM/include/c++/v1/string:1216: undefined reference to 
`__cxa_free_exception'"
I think these symbol is in c++.dll, but linker just say they not exist.
I have no way to get it work.
Please help me if you known any reason about it.

---
ownssh
ownsshaim at aol.com






More information about the cfe-dev mailing list