dPrintMatrix has C++ name mangling using gcc4.8.2
Issue #27
resolved
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)
-
-
Created pull request
-
Account Deactivated - changed status to resolved
Fixed
- Log in to comment
The issue is probably the following: Changelog https://bitbucket.org/odedevs/ode/commits/a3d6180c1cb75d54bbc3ed0f9e14fa2698885533 "format strings should be const" modified the file include/ode/misc.h but did not modify ode/src/misc.cpp, thus breaking the API. (The exported function signature does not correspond anymore with the one in misc.cpp, thus it is not exported correctly/mangled properly)