[vtkusers] linking vtk application, mingw

c674 c674332 at web.de
Mon Dec 1 16:42:35 EST 2008


Thanks for your reply!
Yes, so far I did not use cmake. I could only find tutorials using cmake to
build vtk, none to build my own applications using it - would using it make
a difference?

I did not include all libraries for I did not need them when linking on my
linux system. But even when I link to all libraries I could find in my vtk
lib folder, using 
<g++ main.o postprocessor.o -L C:\msys\1.0\lib\vtk-5.2 -lvtkNetCDF
-lvtkverdict -lvtkRendering -lvtkzlib -lvtkViews -lvtkVolumeRendering
-lvtkWidgets -lvtkexoIIc -lvtkexpat -lvtkCommon -lvtkfreetype
-lvtkDICOMParser -lvtkftgl -lvtkFiltering -lvtkjpeg -lvtkGenericFiltering
-lvtklibxml2 -lvtkGraphics -lvtkmetaio -lvtkHybrid -lvtkpng -lvtkIO
-lvtksqlite -lvtkImaging -lvtksys -lvtkInfovis -lvtktiff>
I still geta huge list of undefined references like this (random excerpt):
C:\msys\1.0\lib\vtk-5.2/libvtkHybrid.a(vtkImplicitModeller.obj):vtkImplicitModel
ler.cxx:(.text$_Z32vtkImplicitModellerAppendExecuteIhEvP19vtkImplicitModellerP10
vtkDataSetP12vtkImageDatadPT_[void vtkImplicitModellerAppendExecute<unsigned
cha
r>(vtkImplicitModeller*, vtkDataSet*, vtkImageData*, double, unsigned
char*)]+0x
520): undefined reference to `vtkImageIterator<unsigned char>::NextSpan()'
C:\msys\1.0\lib\vtk-5.2/libvtkIO.a(vtkDataWriter.obj):vtkDataWriter.cxx:(.text+0
x4b5c): undefined reference to `vtkByteSwap::SwapWrite2BERange(void const*,
int,
 std::ostream*)'
C:\msys\1.0\lib\vtk-5.2/libvtkIO.a(vtkDataWriter.obj):vtkDataWriter.cxx:(.text+0
x4bb4): undefined reference to `vtkByteSwap::SwapWrite4BERange(void const*,
int,
 std::ostream*)'

I'd be grateful for any more input!


Bill Lorensen-2 wrote:
> 
> So I guess you are not using cmake to build your example.
> 
> That said, you are missing many of the vtk libraries. Look in
> C:\msys\1.0\lib\vtk-5.2 and see the other libraries there. You
> probably need to list all of them.
> 
> Bill
> 
> On Thu, Nov 27, 2008 at 4:46 PM, c674 <c674332 at web.de> wrote:
>>
>> Hello,
>>
>> I'm trying to compile an application that runs fine on Linux on Windows
>> (XP) using MinGW. Building (also with MinGW) and installing VTK itself
>> went well. But when linking my application I get an endless (at least it
>> didn't end withing minutes) list of undefined references:
>>
>> C:\Sph\pp>g++ main.o postprocessor.o -L C:\msys\1.0\lib\vtk-5.2
>> -lvtkCommon -lvtkGraphics -lvtkRendering -lvtkHybrid
>> postprocessor.o:postprocessor.cpp:(.text+0x2c0): undefined reference to
>> `vtkData
>> SetAttributes::GetScalars()'
>> ...
>> postprocessor.o:postprocessor.cpp:(.text$_ZN12vtkAlgorithm13GetOutputPortEv[vtkA
>> lgorithm::GetOutputPort()]+0x15): undefined reference to
>> `vtkAlgorithm::GetOutpu
>> tPort(int)'
>> C:\msys\1.0\lib\vtk-5.2/libvtkCommon.a(vtkObjectFactory.obj):vtkObjectFactory.cx
>> x:(.text+0x44a): undefined reference to `vtksys::Directory::Directory()'
>> ...
>> (little longer example: http://codepad.org/TfX1fGaA not sure how long it
>> will be available)
>>
>> I would be thankful for any hint on what could go wrong and on how to fix
>> it.
> 

-- 
View this message in context: http://www.nabble.com/linking-vtk-application%2C-mingw-tp20726011p20781173.html
Sent from the VTK - Users mailing list archive at Nabble.com.




More information about the vtkusers mailing list