On 2020-07-14 05:33, Boris Carvajal wrote:
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.
I based on previous messages and the usage
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
On Monday, 13 July 2020 at 09:34:35 UTC, zoujiaqing wrote:
I changed string to basic_string.
/// source/main.d
import std.stdio;
import core.stdcpp.string;
extern(C++)
{
class Canvas
{
@disable this();
static Canvas Create();
basic_string!ubyte Foo();
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++
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
I changed string to basic_string.
/// source/main.d
import std.stdio;
import core.stdcpp.string;
extern(C++)
{
class Canvas
{
@disable this();
static Canvas Create();
basic_string!ubyte Foo();
basic_string!ubyte Bar();
};
}
void main()
{
/// Canvas.hpp
#include ;
class Canvas
{
static Canvas* Create();
std::string Foo();
std::string Bar();
};
/// Canvas.cpp
#include "Canvas.hpp"
#include
Canvas* Canvas::Create()
{
return new Canvas();
}
std::string Canvas::Foo()
{
return "Foo";
}
std::string