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

ownssh ownsshaim at aol.com
Mon Jul 28 08:56:28 PDT 2014


Thank you for reply.
libsupc++ in mingw64 i686-4.9.1-release-posix-dwarf-rt_v3-rev0 only 
provide object file: C:\LLVM\lib\gcc\i686-w64-mingw32\4.9.1\libsupc++.a.
I can sure libc++ static linked libsupc++ and exported the symbol that 
reported not found,
$ nm -g libc++.dll | grep -i cxa_throw
6c46bff0 T ___cxa_throw
$ nm -g libc++.dll | grep -i cxa_free
6c46bb90 T ___cxa_free_dependent_exception
6c46bc20 T ___cxa_free_exception
but linker just cannot find them.
If you can use libc++ on windows please tell me your mingw version and 
how you build libc++, thank you again.


---
ownssh
ownsshaim at aol.com



-----Original Message-----
From: Jonathan Roelofs <jonathan at codesourcery.com>
To: ownssh <ownsshaim at aol.com>; cfe-dev <cfe-dev at cs.uiuc.edu>
Sent: Mon, Jul 28, 2014 2:00 pm
Subject: Re: [cfe-dev] cannot use libc++ with mingw-64




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