[vtkusers] different name-mangling on different machines

David Gobbi david.gobbi at gmail.com
Sat Mar 17 11:06:49 EDT 2012


Hi Jody,

The mangled names should only be different if the two compiles
are seeing different versions of jni.h, which is the header file
that defines the typedefs for jobject and the other java types.

Do "find /usr -name jni.h" to see if either system has multiple
copies of the header.  You can look in this file to see how it
defines the types.

 - David


On Sat, Mar 17, 2012 at 7:07 AM, jody <jody.xha at gmail.com> wrote:
> 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