[vtkusers] different name-mangling on different machines

jody jody.xha at gmail.com
Sat Mar 17 09:07:23 EDT 2012


Hi

I have to get a VTK-based Java-Application running which was written
some time ago by a former Coworker.

As far as i understand the structure, various C++-classes using VTK
are compiled and linked into a so-file.

Now on one machine (gentoo2.6.39-r3, 64-bit) everything links well,
and the Java-Application can
access the function from the so-file.

On another machine ( 2.6.38-gentoo-r6, 64 bit) everything also
compiles and links well,
but the Java-Application crashes when it wants to acces the functions
in the so file.

The difference is that on the first system the function
vtkJavaGetPointerFromObject appears in the so-file as
    U _Z27vtkJavaGetPointerFromObjectP7JNIEnv_P8_jobject
whereas on the "bad" system it is
    U _Z27vtkJavaGetPointerFromObjectP10_Jv_JNIEnvP9__jobject

But on both systems the so-file 'libvtkCommonJava'.so (created when
installing VTK) defines this function as
       _Z27vtkJavaGetPointerFromObjectP7JNIEnv_P8_jobject
Also other so files from the VTK installation which use this function have
    U _Z27vtkJavaGetPointerFromObjectP7JNIEnv_P8_jobject
on both systems!

On both systems i first installed VTK (with ccmake) and immediatley
after that i created the other library.
I.e. same compiler for both builds (gnu x86_64-pc-linux-gnu-4.6.2 on
both machines)

Does anybody know how this difference in the name-mangling for the VTK
function can happen?
Especially since on the "bad" machine we get correct references for
this function in the VTK build
but not for the build of the own library.


Thank You
  Jody



More information about the vtkusers mailing list