[vtkusers] Changes to jmorecfg.h to make Windows DLL (MinGW)
HIRAKI Hideaki
hhiraki at lab.nig.ac.jp
Mon Feb 13 09:40:31 EST 2006
Hello Martin,
vtktiff sources have "__declspec(dllimport) and __declspec(dllexport)
parts of the makros". You should remove them (and more?), too. I think
the problem is not specific to VTK, and some informations are available
from MinGW documents and its community.
Anyway, VTK5.0's dlls could be built on MinGW without editing the
sources, setting '-Wl,--export-all-symbols' to CMAKE_SHARED_LINKER_FLAGS
with CMake2.2.3.
Cheers,
Hideaki Hiraki
At Sun, 12 Feb 2006 23:04:01 +0100, Martin Baumann wrote:
> I did some changes to the source: removed all __declspec(dllimport) and
> __declspec(dllexport) parts of the makros.
> libvtkjpeg.dll is linked without error messages.
>
> Now, I get the following error when libvtktiff.dll is being linked:
> ... tif_jpeg.c: undefined reference to `_imp__vtk_jpeg_abort´
> ... tif_jpeg.c: undefined reference to `_imp__vtk_jped_std_error´
> ... and a lot more ...
>
> when I look at the symbols of libvtkjpeg.dll I see (->nm libvtkjpeg.dll):
> 100240bc I _vtk_jpeg_abort
> 10001717 T _vtk_jpeg_std_error
> ... and a lot more ...
>
> To me this seems as if the symbol names are wrong: only the '_imp_' is
> to much!
>
> How can I make the the compiler / linker give the functions the correct
> names?
> Or make the linker use the wrong names?
> Or can I change the symbol names without creating new dll files?
>
>
> Regards, Martin
>
>
>
>
> I
>
> Martin Baumann schrieb:
>
> >Hi,
> >
> >I have problems linking VTK-5.0 with MinGW as shared libraries.
> >
> >At linking time I get:
> > Linking CXX shared library ../bin/libvtkRendering.dll
> > Info: resolving vtable for vtkPropCollectionby linking to __imp___ZTV17vtkPropCollection (auto-import)
> > Info: resolving vtable for vtkSimpleCriticalSectionby linking to __imp___ZTV24vtkSimpleCriticalSection (auto-import)
> > Info: resolving vtable for vtkMapper2Dby linking to __imp___ZTV11vtkMapper2D (auto-import)
> > CMakeFiles/vtkRendering.dir/vtkTesting.obj(.text+0x1d0d):vtkTesting.cxx: undefined reference to `vtkPNGWriter::New()'
> > CMakeFiles/vtkRendering.dir/vtkTesting.obj(.text+0x2b7b):vtkTesting.cxx: undefined reference to `vtkJPEGWriter::New()'
> > CMakeFiles/vtkRendering.dir/vtkTesting.obj(.text$_ZN15vtkSmartPointerI12vtkPNGReaderE3NewEv[vtkSmartPointer<vtkPNGReader>::New()]+0xb):vtkTesting.cxx: undefined reference to `vtkPNGReader::New()'
> > collect2: ld returned 1 exit status
> > make[2]: *** [bin/libvtkRendering.dll] Error 1
> > make[1]: *** [Rendering/CMakeFiles/vtkRendering.dir/all] Error 2
> > make: *** [all] Error 2
> >
> >Does anyone have experience with that?
> >
> >I guess that in jmorecfg.h (part of Utilities/vtkjpeg) changes need to be done. Also in pngconf.h (part of Utilities/vtkpng).
> >Vincent Nicolas helped me with a similar problem: it was due to dll export/import directives. These made problems with gcc as a linker. Therefore changes were made so that no symbols exports were declared. This worked in the case of the 'Common'-part of VTK.
> >
> >
> >Regards,
> >
> >MB
More information about the vtkusers
mailing list