[vtkusers] Changes to jmorecfg.h to make Windows DLL (MinGW)

Martin Baumann mailsgetlost at web.de
Sun Feb 12 17:04:01 EST 2006


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
>______________________________________________________________
>Verschicken Sie romantische, coole und witzige Bilder per SMS!
>Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193
>
>_______________________________________________
>This is the private VTK discussion list. 
>Please keep messages on-topic. Check the 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