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

Jonathan Roelofs jonathan at codesourcery.com
Mon Jul 28 07:00:34 PDT 2014



On 7/27/14, 10:28 AM, ownssh wrote:
> 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'"
These symbols should be coming from your C++ ABI library... Check your -lsupc++ 
for them, that's where they ought to live.

Jon
> 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
>
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

-- 
Jon Roelofs
jonathan at codesourcery.com
CodeSourcery / Mentor Embedded



More information about the cfe-dev mailing list