Bind C++ class to DLang : undefined reference to `Canvas::Foo()'

Boris Carvajal boris2.9 at gmail.com
Tue Jul 14 03:33:27 UTC 2020


On Monday, 13 July 2020 at 16:17:55 UTC, zoujiaqing wrote:
> On Monday, 13 July 2020 at 12:57:52 UTC, Adam D. Ruppe wrote:
>> On Monday, 13 July 2020 at 09:34:35 UTC, zoujiaqing wrote:
>>> # dmd source/main.d Canvas.o -L-lstdc++ && ./main
>>> [1]    49078 segmentation fault  ./main
>>
>> On my computer I got this warning out of the compiler:
>>
>> libstdc++ std::__cxx11::basic_string is not yet supported; the 
>> struct contains an interior pointer which breaks D move 
>> semantics!
>>
>>
>> sounds like it might be a known limitation.
>
> Thanks Adam, but D link to C++ very hard?

Can you try passing -D_GLIBCXX_USE_CXX11_ABI=0 to g++ and 
-version=_GLIBCXX_USE_CXX98_ABI to dmd.

That comes from: 
https://dlang.org/changelog/2.088.0.html#std_string

C++11 ABI is currently not supported.


More information about the Digitalmars-d-learn mailing list