VTK5.10.0 + Java7 : compilation problem

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

VTK5.10.0 + Java7 : compilation problem

brenaud
This post has NOT been accepted by the mailing list yet.
This post was updated on .
Hi everybody,

This is my first post, so be patient please... :)
I've search (and found) a lot of posts similars as this one, but i haven't found any real/working solution for this problem.

Context: I've a project/demo that must use VTK with the Swing gui in Java7 (for Nimbus look and feel). The demo will have to load/render complex geometry and add+modify more basics objects such as hexaedron.
Before loading/working with these objects I must compile VTK... and here is my config :
- VTK : 5.10.0
- CMake : 2.8.8 (win32)
- MinGW : 20120426
- Java : jdk1.7.0_05
- Windows 7 (64bits)

I've followed the compilation tutorials found on the FAQ, and some other details on other tutorials, but during the compilation I have the following errors (at 73% of the compilation):
Linking CXX shared library ..\bin\libvtkRenderingJava.dll
Creating library file: ..\bin\libvtkRenderingJava.dll.a
CMakeFiles\vtkRenderingJava.dir/objects.a(vtkRenderWindowJava.cxx.obj): In function `Java_vtk_vtkPanel_RenderCreate@12':
C:/vtk-5.10.0/source/Common/vtkJavaAwt.h:57: undefined reference to `_imp__JAWT_GetAWT@8'
CMakeFiles\vtkRenderingJava.dir/objects.a(vtkRenderWindowJava.cxx.obj): In function `Java_vtk_vtkPanel_Lock@8':
C:/vtk-5.10.0/source/Common/vtkJavaAwt.h:157: undefined reference to `_imp__JAWT_GetAWT@8'
CMakeFiles\vtkRenderingJava.dir/objects.a(vtkRenderWindowJava.cxx.obj): In function `Java_vtk_vtkPanel_UnLock@8':
C:/vtk-5.10.0/source/Common/vtkJavaAwt.h:214: undefined reference to `_imp__JAWT_GetAWT@8'
collect2: ld a retourné 1 code d'état d'exécution
mingw32-make[2]: *** [bin/libvtkRenderingJava.dll] Error 1
mingw32-make[1]: *** [Rendering/CMakeFiles/vtkRenderingJava.dir/all] Error 2
mingw32-make: *** [all] Error 2

I've configured advanced options in CMake with :
- JAVA_AWT_INCLUDE_PATH :   C:/Program Files/Java/jdk1.7.0_05/include
- JAVA_AWT_LIBRARY :        C:/Program Files/Java/jdk1.7.0_05/lib/jawt.lib
- JAVA_INCLUDE_PATH :       C:/Program Files/Java/jdk1.7.0_05/include
- ...

Is anyone can help me ? Pleaaase...

PS: Excuse my faults, I'm not a shakespearian ;)
Reply | Threaded
Open this post in threaded view
|

Re: VTK5.10.0 + Java7 : JAWT_GetAWT linking problem

brenaud
It seems to be the same problem as Satya...

I've read that I must add "-jawt" in LD_LIBRARY_PATH, but I don't find this line in the CMake config (maybe because i'm on windows).
Reply | Threaded
Open this post in threaded view
|

Re: VTK5.10.0 + Java7 : JAWT_GetAWT linking problem

brenaud
I've found the origin of my linking problem for JAWT_GetAWT.

I had installed jdk7 64bits, corresponding to my Windows7, but the compiled VTK is in 32bits and so the linked names was not exactly the same.

I've just installed the jdk7 32bits and my problem has been resolved.
Reply | Threaded
Open this post in threaded view
|

Re: VTK5.10.0 + Java7 : JAWT_GetAWT linking problem

satya
Hi benaud/vtkUsers
      You will be able to compile vtk with these changes. But when you tried to link the vtk dlls to project you will get strange errors.

Thanks
Satya 

On Tue, Jul 10, 2012 at 5:42 AM, brenaud <[hidden email]> wrote:
I've found the origin of my linking problem for JAWT_GetAWT.

I had installed jdk7 64bits, corresponding to my Windows7, but the compiled
VTK is in 32bits and so the linked names was not exactly the same.

I've just installed the jdk7 32bits and my problem has been resolved.

--
View this message in context: http://vtk.1045678.n5.nabble.com/Resolved-VTK5-10-0-Java7-JAWT-GetAWT-linking-problem-tp5714559p5714586.html
Sent from the VTK - Users mailing list archive at Nabble.com.
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: VTK5.10.0 + Java7 : JAWT_GetAWT linking problem

brenaud
Yes, it's true...

The "lib" prefix to the dll seems to be a known bug, so I change the code to :
String[] libs = { "vtkCommonJava", "vtkFilteringJava", "vtkIOJava",
	"vtkImagingJava", "vtkGraphicsJava", "vtkRenderingJava"};
for (String lib : libs) {
	System.loadLibrary("lib" + lib);
}

After that, I've got an other problem : "libvtkCommonJava.dll: Can't find dependent libraries".
I run "Dependency Walker" on "libvtkCommonJava.dll" and I see that :
LIBVTKCOMMONJAVA.DLL
  LIBVTKCOMMON.DLL
    USER32.DLL
      POWRPROF.DLL
        SETUPAPI.DLL
          SHELL32.DLL
            SHDOCVW.DLL
              IEFRAME.DLL
                IESHIMS.DLL  // Not found
          USERENV.DLL
            GPSVC.DLL  // Not found

Is it a problem coming from my windows ?
Reply | Threaded
Open this post in threaded view
|

Re: VTK5.10.0 + Java7 : JAWT_GetAWT linking problem

jruiz
I'm getting the same error:

libvtkCommonJava.dll: Can't find dependent libraries

did somebody find the solution?

Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: VTK5.10.0 + Java7 : JAWT_GetAWT linking problem

brenaud
I've resolved the problem by compiling VTK with Visual Studio (because unfortunately I failed to find the solution with MinGW) and add the msvcrXX.dll (and may be an other one...) into the vtk dll folder.

Don't forget to append the vtk dll path to the environnement variable PATH, because the dlls works together using PATH and not the "java.library.path".

I hope this will help you.
Reply | Threaded
Open this post in threaded view
|

Re: VTK5.10.0 + Java7 : JAWT_GetAWT linking problem

jruiz
Yes It helps!, thanks!
Did you manage to build a 32bits version on a 64bits windows.

When I try to use "visualStudio 10" instead "VisualStudio 10 64bits" in the configuration process, CMake shows an error: "wasn't able to compile a simple program..." or something like that.

May I need an especial SDK to build 32bits applications with 64bits machines?

Thanks! 

2012/9/28 brenaud <[hidden email]>
I've resolved the problem by compiling VTK with Visual Studio (because
unfortunately I failed to find the solution with MinGW) and add the
msvcrXX.dll (and may be an other one...) into the vtk dll folder.

Don't forget to append the vtk dll path to the environnement variable PATH,
because the dlls works together using PATH and not the "java.library.path".

I hope this will help you.



--
View this message in context: http://vtk.1045678.n5.nabble.com/VTK5-10-0-Java7-compilation-problem-tp5714559p5716345.html
Sent from the VTK - Users mailing list archive at Nabble.com.
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: VTK5.10.0 + Java7 : JAWT_GetAWT linking problem

brenaud
I forget that...

There is may be an option in CMake saying 32bits target, isn't it ?

_______________________________________


L'intégrité de ce message n'étant pas assurée sur internet, AKKA TECHNOLOGIES et ses filiales ne peuvent être tenues responsables de son contenu. Ce message et les éventuels fichiers attachés contiennent des informations confidentielles. Au cas où il ne vous serait pas destiné, nous vous remercions de bien vouloir le supprimer et en aviser l'expéditeur. Toute utilisation de ce message non conforme à sa destination, toute diffusion ou toute publication, totale ou partielle, est interdite, sauf autorisation expresse.



This message and the files that may be attached to it contain confidential information. AKKA TECHNOLOGIES or its subsidiaries may not be held responsible for their contents, whose accuracy and completeness cannot be guaranteed over the internet. If the message is not addressed to you, kindly delete it and notify the sender. Any use of this message not in accordance with its purpose, any dissemination or disclosure, either whole or partial, is prohibited except formal approval.


________________________________________
Reply | Threaded
Open this post in threaded view
|

Re: VTK5.10.0 + Java7 : JAWT_GetAWT linking problem

jruiz
Doesn't work, I can chose between "visual studio 10" & "visual stuidio 10 64bits" , when I try to use visual studio 10 CMake throw me the error what I told before, in the previous mail.

I think is going to be easier to try it in a Windows XP machine.
 

2012/10/1 brenaud <[hidden email]>
I forget that...

There is may be an option in CMake saying 32bits target, isn't it ?

_______________________________________


L'intégrité de ce message n'étant pas assurée sur internet, AKKA TECHNOLOGIES et ses filiales ne peuvent être tenues responsables de son contenu. Ce message et les éventuels fichiers attachés contiennent des informations confidentielles. Au cas où il ne vous serait pas destiné, nous vous remercions de bien vouloir le supprimer et en aviser l'expéditeur. Toute utilisation de ce message non conforme à sa destination, toute diffusion ou toute publication, totale ou partielle, est interdite, sauf autorisation expresse.



This message and the files that may be attached to it contain confidential information. AKKA TECHNOLOGIES or its subsidiaries may not be held responsible for their contents, whose accuracy and completeness cannot be guaranteed over the internet. If the message is not addressed to you, kindly delete it and notify the sender. Any use of this message not in accordance with its purpose, any dissemination or disclosure, either whole or partial, is prohibited except formal approval.


________________________________________


View this message in context: Re: VTK5.10.0 + Java7 : JAWT_GetAWT linking problem
Sent from the VTK - Users mailing list archive at Nabble.com.

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers



_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: VTK5.10.0 + Java7 : JAWT_GetAWT linking problem

julien von siebenthal
Hi,
 
This is a problem with your JVM. You must use a 32 bit JVM here.
 
Best,
Julien

On Tue, Oct 2, 2012 at 2:14 AM, Jonathan Ruiz Peinado <[hidden email]> wrote:
Doesn't work, I can chose between "visual studio 10" & "visual stuidio 10 64bits" , when I try to use visual studio 10 CMake throw me the error what I told before, in the previous mail.

I think is going to be easier to try it in a Windows XP machine.
 

2012/10/1 brenaud <[hidden email]>
I forget that...

There is may be an option in CMake saying 32bits target, isn't it ?

_______________________________________


L'intégrité de ce message n'étant pas assurée sur internet, AKKA TECHNOLOGIES et ses filiales ne peuvent être tenues responsables de son contenu. Ce message et les éventuels fichiers attachés contiennent des informations confidentielles. Au cas où il ne vous serait pas destiné, nous vous remercions de bien vouloir le supprimer et en aviser l'expéditeur. Toute utilisation de ce message non conforme à sa destination, toute diffusion ou toute publication, totale ou partielle, est interdite, sauf autorisation expresse.



This message and the files that may be attached to it contain confidential information. AKKA TECHNOLOGIES or its subsidiaries may not be held responsible for their contents, whose accuracy and completeness cannot be guaranteed over the internet. If the message is not addressed to you, kindly delete it and notify the sender. Any use of this message not in accordance with its purpose, any dissemination or disclosure, either whole or partial, is prohibited except formal approval.


________________________________________


View this message in context: Re: VTK5.10.0 + Java7 : JAWT_GetAWT linking problem
Sent from the VTK - Users mailing list archive at Nabble.com.

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers



_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers



_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers