dPrintMatrix has C++ name mangling using gcc4.8.2

Issue #27 resolved
smandy created an issue

HI,

I've been using the DerelictODE binding for the D language and had a bit of trouble linking. It came back to the dPrintMatrix function which has a C++ mangled name in the .so produced when I compile tip with --enable-shared.

I played around and it looks like the const in the function signature forces the method to snap back into C++ name mangling even though extern(C) has been specified earlier by the C preprocessor.

It's debatable if the const should be dropped solely to please another language but I think in terms of consistency it's a bit ugly having one symbol with C++ mangling alongside other functions with normal C linkage.

Cheers

A.

 for `all-am'.
make[1]: Leaving directory `/home/andy/repos/ode2'
andy@raffles:~/repos/ode2$ nm ode/src/.libs/libode.so | grep dPrintMatrix
0000000000057770 T _Z12dPrintMatrixPKfiiPcP8_IO_FILE
andy@raffles:~/repos/ode2$ nm ode/src/.libs/libode.so | grep dMakeRandomVector
0000000000057840 T dMakeRandomVector
andy@raffles:~/repos/ode2$ nm ode/src/.libs/libode.so | grep dMakeRandomMatrix
0000000000057890 T dMakeRandomMatrix
andy@raffles:~/repos/ode2$ 

Comments (3)

  1. Log in to comment