[vtkusers] VTK and MinGW on Windows 7

Jim Peterson jimcp at cox.net
Thu Sep 23 16:56:27 EDT 2010


Bill Lorensen wrote:
> I use mingw all of the time to build vtk with shared libraries. I do
> not use QT however.
>
> I also install msys and run from that shell.
>
> Bill
>   
Bill,
That is the environmental assumption I hit exactly, the resultant 
libraries are Unix-ish, ie libvtkCommon... If you where hoping to get a 
library you could use from Java under Windows, Java does not find 
"vtkCommonJava.dll" because the Make from the windows command line 
produces "libvtkCommonJava.dll" (kind of a hybrid name between the unix 
lib prefix and the Windows DLL suffix). If I change the Java statement 
to load the libraries from the intended to be universal 
System.LoadLibrary("vtkCommonJava") to specify "libvtkCommonJava" it 
fails to find the actual shared library vtkCommon.DLL which is named 
libvtkCommon.Dll. a simple rename does not resolve this problem because 
of the internal name mangling apparently. bottom line is if you want 
java wrappers that work in windows, this far, I have not been able to 
use the MingW compiler. After I found I could get Visual Studio Express 
as a free download, I quit trying to get MingW to work, It might be 
possible to use it as the compiler from the eclipse IDE perhaps.

So I can make a native Windows command using MingW that does not require 
Msys or CygWin, but I cannot make a shared VTK library for native 
windows, that is one named vtkCommon.dll, using MingW.

Don't get me wrong, If it is working as intended, that is fine. I was 
expecting to be able to build windows libraries with MingW on my first 
read though.

Jim



More information about the vtkusers mailing list