[vtkusers] Problems using VTK with Java in Windows XP

joe at fluiditymed.com joe at fluiditymed.com
Mon Jan 3 13:46:27 EST 2011


I am compiling on a Windows XP machine. I do not have access to a Windows
Vista/7 machine for VTK development.

The dependent-library problem that I am running into is caused by IE7
running on a Windows XP machine. (My understanding is that this is not a
problem when running IE7 on Vista/7.) Apparently VTK is calling routines
in libraries which contain broken dependencies. Ordinarily, these don't
appear to cause a problem in general use as these dependencies are
delay-loading dependencies and an attempt to resolve them is put off until
runtime. However, when calling System.loadLibrary("vtkRenderingJava"), it
appears that a dependency check is made which uncovers the broken
dependencies (and running Dependency Checker reveals the broken
dependencies). Unfortunately, it appears that Java won't allow
vtkRenderingJava to be loaded unless all of the broken dependencies are
resolved, even if these dependencies are actually not called at runtime.

I am running into three dependent-library issues related to the loading of
vtkRenderingJava:

1. Missing DWMAPI.DLL. This module only exists on Windows Vista/7
machines. Simply copying this DLL to Windows XP does not solve the problem
as this would require copying more than just DWMAPI.DLL (since DWMAPI.DLL
itself has dependencies which do not exist on a standard Win XP
installation). I have solved this problem by creating a dummy DWMAPI.DLL
library containing the DwmExtendFrameIntoClientArea() method.

2. SHLWAPI.DLL missing function #467 (called from IEFRAME.DLL).

3. MPR.DLL missing WNetRestoreConnectionA().

I cannot resolve 2. and 3. through the use of dummy DLLs. In any case, I
shouldn't have to generate dummy DLLs in order to get vtkRenderingJava
loaded. Uninstalling IE7 is also not an option, either.

Has anyone come across a similar situation and if so, how did you get
around it? Is there some way of circumventing the checking for
dependencies in System.loadLibrary() that I don't know about? I cannot
imagine that I am the only vtk user who has ever run into such a problem.

Once again, thanks for any help which can be provided.

Kind regards,
Joe


> I guess you should do your compilation on Win XP and not windows 7.
> Or try to put the dll from Win7 in your path on XP.`
>
> Seb
>
> On Sat, Jan 1, 2011 at 3:48 PM,  <joe at fluiditymed.com> wrote:
>> Hello,
>>
>> I am trying to get VTK with Java binding to work on a Windows XP
>> machine.
>> I have generated a build using Visual Studio 2008 Express Edition. When
>> I
>> try to run the Cone application, I am getting the following:
>>
>> java.lang.UnsatisfiedLinkError:
>> C:\VTK-Build\bin\Release\vtkRenderingJava.dll: Can't find dependent
>> libraries
>>        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
>>        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751)
>>        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1676)
>>        at java.lang.Runtime.loadLibrary0(Runtime.java:823)
>>        at java.lang.System.loadLibrary(System.java:1030)
>>        at cone.Main.<clinit>(Main.java:36)
>> Exception in thread "main" Java Result: 1
>>
>> Using Dependency Checker, I have managed to trace this to a missing
>> DWMAPI.DLL file from vtkRenderingJava.dll. The problem is that
>> DWMAPI.DLL
>> is a Vista/Win 7 file and does not exist in Windows XP.
>>
>> Is there a way of getting around this problem?
>>
>> Thanks for any help that you can provide.
>>
>> Kind regards,
>> Joe
>>
>> _______________________________________________
>> 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
>>
>





More information about the vtkusers mailing list