g++ -c foo.cpp
dmd bar.d foo.o -L-lstdc++
foo.o:foo.d:function _Dmain: error: undefined reference to 'void increment<int>(Foo<int>&)'
foo.o:foo.d:function _Dmain: error: undefined reference to 'void increment<char>(Foo<char>&)'
foo.o:foo.d:function _Dmain: error: undefined reference to 'void printThreeNext<char>(Foo<char>)'
collect2: error: ld returned 1 exit status
Comment #1 by bugzilla — 2019-12-18T10:44:14Z
Which example do you mean?
I tried the one on: https://dlang.org/spec/cpp_interface.html and got the expected result (A, B and C in separate lines). Is this the correct one?
Comment #2 by robert.schadek — 2024-12-15T15:24:28Z