binding to C++

Nicholas Wilson via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri May 26 16:44:16 PDT 2017


On Friday, 26 May 2017 at 15:17:08 UTC, drug wrote:
> Trying to bind to cpp code I stop at some moment having 
> undefined reference to some cpp function. But objdump -Ct 
> cpplibrary.so shows me that this cpp function exists in the 
> library. linker message about cpp function is _identical_ to 
> objdump message so I don't know where is the difference. For 
> example linker says:
> `undefined reference to 
> `Namespace::StructName::method_name(Namespace::Otherstruct 
> const*)`
> And ojbdump called by command:
> ```
> objdump -Ct libLibrary.so | method_name
> ```
> shows the following:
> ```
> 0000000000026ed0  w    F .text  0000000000000025 
> Namespace::StructName::method_name(Namespace::Otherstruct 
> const*)
> ```
> That is two outputs are identical.
> Could someone help what to do to investigate the problem?
> Thanks in advance

Thats weird. DMD may have got the mangling wrong. Could you post 
the exact mangling (i.e. non-demangled)? And if DMD has got it 
wrong and its just the one function you could just 
`pragma(mangle, ...);` it.


More information about the Digitalmars-d-learn mailing list