From a test to make C++ and D talk to each others:
D side:
import std.stdio;
extern (C++) void CallFromCPlusPlusTest() {
writeln("You can call me from C++");
}
C++ side:
#include <iostream>
using namespace std;
void CallFromCPlusPlusTest();
int main() {
cout << "hello world"<<"\n";
CallFromCPlusPlusTest();
}
flags used for DMD: -g -debug -w
Linking the 2 objects files with gold produce the following error:
bin/gold/ld: internal error in make_view, at fileread.cc:395
collect2: error: ld returned 1 exit status
I suspect this is a gold bug rather than a dmd bug, but as the problem do not manifest with gcc and/or clang, I doubt we get much traction on their side.
The version of gold used is "GNU gold (GNU Binutils 2.21.1) 1.11"
Comment #1 by robert.schadek — 2024-12-13T18:35:03Z