Passing string from D to c++

Walter Bright newshound2 at digitalmars.com
Tue Jul 30 19:53:47 PDT 2013


On 7/30/2013 3:01 PM, John Colvin wrote:
> $ dmd -c -m64 inter.d
> $ g++ -c -m64 inter.cpp -ointercpp.o
> $ g++ inter.o intercpp.o -ointer -lphobos2
> inter.o: In function `_Dmain':
> inter.d:(.text._Dmain+0x48): undefined reference to `printString(CppString*)'
> collect2: error: ld returned 1 exit status

You might want to look at the name mangling of the D printString vs the name 
mangling of the C++ one.



More information about the Digitalmars-d mailing list