[vtkusers] Problem moving from win to linux (vtkImagePlaneWidget and vtk Mappers)

Peter F Bradshaw pfb at exadios.com
Fri May 26 13:12:51 EDT 2006


Hi Matteo;

On Fri, 26 May 2006, Matteo Campana wrote:

> Hi all,
>
> I'm trying to port my ITK/VTK application from windowsXP to linux (Fedora core 4)
>
> On both the OS I sucessfully installed the same software:
>
> CMAKE 2.0.6
> ITK 2.2.0
> VTK 4.2-LatestRelease
> FLTK 1.1.4
>
> but when i try to build the application in linux, it fails.
> It has some problems with vtkImagePlaneWidget an vtk Mappers.
>
> Building in windows with Visual C++ 6.0 it works.
> Building in linux with gcc 4.0 with the same CMAKE List it doesn't!!
>
> Is gcc4.0 compatible with VTK 4.2?!
> Compiling VTK with gcc4.0 i had to change source code of vtkBMPReader and vtkImageReader filter as i found in the forum!
> Have i to change some other filters in VTK?!?
> I also tryed to build the application with VTK 4.4 but the building fails with the same errors!!

I can confirm that VTK 4.2 builds on Linux without any modifications.
However, I'm not sure about gcc 4.0 and VTK. If you suspect a problem
with gcc 4.0 you may want to try gcc 3.3 - which should be avaliable for
Fedora.

>
> It seems that it can't link two object that are in different library (es. vtkImagePlaneWidget(Hybrid lib) and vtkPlaneSource(Graphics lib)).
> I had the same problem with library of my application..and i just resolved it writing in CMakeList file something like LINK_LIBRARIES(libA libB ecc).
> How can i do the same for VTK?!
> What am I missing?!

I notice below that you are linking statically to VTK. Is this what you
want to do? Most people use dynamic linking to VTK. If you use static
linking then it is your responsibility to explicitly link all libraries
in a dependecy tree - irrespective of whether you use then directly or
indirectly.  That is you must explicitly link your libraries / objects
in your makefile or write the code in your CMakeList (if you're using
Cmake).

Unless you have a good reason for using static linking I recomend dynamic
linking which should resolve your problem. With dynamic linking it is
only necessary to link against the libraries that your library / object
uses and not the whole dependecy tree.

>
> Thank you!
> Matteo
>
>
> Here are the error messages:
>
> .
> .
> .
> .
> Building executable /usr/local/src/MyCode/VIP/EmbryomicsLocal...
> /usr/local/src/MyCode/VTKbin/bin/libvtkHybrid.a(vtkImagePlaneWidget.o)(.text+0x3d8a): In function `vtkImagePlaneWidget::Push(double*, double*)':
> vtkImagePlaneWidget.cxx: undefined reference to `vtkPlaneSource::Push(float)'
> /usr/local/src/MyCode/VTKbin/bin/libvtkHybrid.a(vtkImagePlaneWidget.o)(.text+0x3e35): In function `vtkImagePlaneWidget::PlaceWidget(float*)':
> vtkImagePlaneWidget.cxx: undefined reference to `vtkPlaneSource::SetPoint1(float, float, float)'
> /usr/local/src/MyCode/VTKbin/bin/libvtkHybrid.a(vtkImagePlaneWidget.o)(.text+0x3e53):vtkImagePlaneWidget.cxx: undefined reference to `vtkPlaneSource::SetPoint2(float, float, float)'
> /usr/local/src/MyCode/VTKbin/bin/libvtkHybrid.a(vtkImagePlaneWidget.o)(.text+0x3eb1):vtkImagePlaneWidget.cxx: undefined reference to `vtkPlaneSource::SetPoint1(float, float, float)'
> /usr/local/src/MyCode/VTKbin/bin/libvtkHybrid.a(vtkImagePlaneWidget.o)(.text+0x3ecf):vtkImagePlaneWidget.cxx: undefined reference to `vtkPlaneSource::SetPoint2(float, float, float)'
> /usr/local/src/MyCode/VTKbin/bin/libvtkHybrid.a(vtkImagePlaneWidget.o)(.text+0x3f1c):vtkImagePlaneWidget.cxx: undefined reference to `vtkPlaneSource::SetPoint1(float, float, float)'
> /usr/local/src/MyCode/VTKbin/bin/libvtkHybrid.a(vtkImagePlaneWidget.o)(.text+0x3f3a):vtkImagePlaneWidget.cxx: undefined reference to `vtkPlaneSource::SetPoint2(float, float, float)'
> /usr/local/src/MyCode/VTKbin/bin/libvtkHybrid.a(vtkImagePlaneWidget.o)(.text+0x42ab): In function `vtkImagePlaneWidget::UpdateOrigin()':
> vtkImagePlaneWidget.cxx: undefined reference to `vtkPlaneSource::SetCenter(float*)'
> /usr/local/src/MyCode/VTKbin/bin/libvtkHybrid.a(vtkImagePlaneWidget.o)(.text+0x4333):vtkImagePlaneWidget.cxx: undefined reference to `vtkPlaneSource::SetCenter(float*)'
> /usr/local/src/MyCode/VTKbin/bin/libvtkHybrid.a(vtkImagePlaneWidget.o)(.text+0x6319): In function `vtkImagePlaneWidget::SetPlaneOrientation(int)':
> vtkImagePlaneWidget.cxx: undefined reference to `vtkPlaneSource::SetPoint1(float, float, float)'
> /usr/local/src/MyCode/VTKbin/bin/libvtkHybrid.a(vtkImagePlaneWidget.o)(.text+0x6337):vtkImagePlaneWidget.cxx: undefined reference to `vtkPlaneSource::SetPoint2(float, float, float)'
> /usr/local/src/MyCode/VTKbin/bin/libvtkHybrid.a(vtkImagePlaneWidget.o)(.text+0x638d):vtkImagePlaneWidget.cxx: undefined reference to `vtkPlaneSource::SetPoint1(float, float, float)'
> /usr/local/src/MyCode/VTKbin/bin/libvtkHybrid.a(vtkImagePlaneWidget.o)(.text+0x63ab):vtkImagePlaneWidget.cxx: undefined reference to `vtkPlaneSource::SetPoint2(float, float, float)'
> /usr/local/src/MyCode/VTKbin/bin/libvtkHybrid.a(vtkImagePlaneWidget.o)(.text+0x63f8):vtkImagePlaneWidget.cxx: undefined reference to `vtkPlaneSource::SetPoint1(float, float, float)'
> /usr/local/src/MyCode/VTKbin/bin/libvtkHybrid.a(vtkImagePlaneWidget.o)(.text+0x6416):vtkImagePlaneWidget.cxx: undefined reference to `vtkPlaneSource::SetPoint2(float, float, float)'
> /usr/local/src/MyCode/VTKbin/bin/libvtkHybrid.a(vtkImagePlaneWidget.o)(.text+0x6c0a): In function `vtkImagePlaneWidget::SetSlicePosition(float)':
> vtkImagePlaneWidget.cxx: undefined reference to `vtkPlaneSource::Push(float)'
> /usr/local/src/MyCode/VTKbin/bin/libvtkHybrid.a(vtkImagePlaneWidget.o)(.text+0x707d): In function `vtkImagePlaneWidget::Scale(double*, double*, int, int)':
> vtkImagePlaneWidget.cxx: undefined reference to `vtkPlaneSource::SetPoint1(float*)'
> /usr/local/src/MyCode/VTKbin/bin/libvtkHybrid.a(vtkImagePlaneWidget.o)(.text+0x7096):vtkImagePlaneWidget.cxx: undefined reference to `vtkPlaneSource::SetPoint2(float*)'
> /usr/local/src/MyCode/VTKbin/bin/libvtkHybrid.a(vtkImagePlaneWidget.o)(.text+0x72a9): In function `vtkImagePlaneWidget::Translate(double*, double*)':
> vtkImagePlaneWidget.cxx: undefined reference to `vtkPlaneSource::SetPoint1(float*)'
> /usr/local/src/MyCode/VTKbin/bin/libvtkHybrid.a(vtkImagePlaneWidget.o)(.text+0x72c2):vtkImagePlaneWidget.cxx: undefined reference to `vtkPlaneSource::SetPoint2(float*)'
> /usr/local/src/MyCode/VTKbin/bin/libvtkHybrid.a(vtkImagePlaneWidget.o)(.text+0x7376):vtkImagePlaneWidget.cxx: undefined reference to `vtkPlaneSource::SetPoint2(float*)'
> /usr/local/src/MyCode/VTKbin/bin/libvtkHybrid.a(vtkImagePlaneWidget.o)(.text+0x73da):vtkImagePlaneWidget.cxx: undefined reference to `vtkPlaneSource::SetPoint1(float*)'
> /usr/local/src/MyCode/VTKbin/bin/libvtkHybrid.a(vtkImagePlaneWidget.o)(.text+0x748e):vtkImagePlaneWidget.cxx: undefined reference to `vtkPlaneSource::SetPoint1(float*)'
> /usr/local/src/MyCode/VTKbin/bin/libvtkHybrid.a(vtkImagePlaneWidget.o)(.text+0x74f2):vtkImagePlaneWidget.cxx: undefined reference to `vtkPlaneSource::SetPoint2(float*)'
> /usr/local/src/MyCode/VTKbin/bin/libvtkHybrid.a(vtkImagePlaneWidget.o)(.text+0x75b8):vtkImagePlaneWidget.cxx: undefined reference to `vtkPlaneSource::SetPoint2(float*)'
> /usr/local/src/MyCode/VTKbin/bin/libvtkHybrid.a(vtkImagePlaneWidget.o)(.text+0x76a8):vtkImagePlaneWidget.cxx: undefined reference to `vtkPlaneSource::SetPoint1(float*)'
> /usr/local/src/MyCode/VTKbin/bin/libvtkHybrid.a(vtkImagePlaneWidget.o)(.text+0x76c1):vtkImagePlaneWidget.cxx: undefined reference to `vtkPlaneSource::SetPoint2(float*)'
> /usr/local/src/MyCode/VTKbin/bin/libvtkHybrid.a(vtkImagePlaneWidget.o)(.text+0x774d):vtkImagePlaneWidget.cxx: undefined reference to `vtkPlaneSource::SetPoint1(float*)'
> /usr/local/src/MyCode/VTKbin/bin/libvtkHybrid.a(vtkImagePlaneWidget.o)(.text+0x7766):vtkImagePlaneWidget.cxx: undefined reference to `vtkPlaneSource::SetPoint2(float*)'
> /usr/local/src/MyCode/VTKbin/bin/libvtkHybrid.a(vtkImagePlaneWidget.o)(.text+0x77f2):vtkImagePlaneWidget.cxx: undefined reference to `vtkPlaneSource::SetPoint1(float*)'
> /usr/local/src/MyCode/VTKbin/bin/libvtkHybrid.a(vtkImagePlaneWidget.o)(.text+0x7acf): In function `vtkImagePlaneWidget::Rotate(double*, double*, double*)':
> vtkImagePlaneWidget.cxx: undefined reference to `vtkPlaneSource::SetPoint1(float*)'
> /usr/local/src/MyCode/VTKbin/bin/libvtkHybrid.a(vtkImagePlaneWidget.o)(.text+0x7b2a):vtkImagePlaneWidget.cxx: undefined reference to `vtkPlaneSource::SetPoint2(float*)'
> /usr/local/src/MyCode/VTKbin/bin/libvtkHybrid.a(vtkImagePlaneWidget.o)(.text+0x7e12): In function `vtkImagePlaneWidget::Spin(double*, double*)':
> vtkImagePlaneWidget.cxx: undefined reference to `vtkPlaneSource::SetPoint1(float*)'
> /usr/local/src/MyCode/VTKbin/bin/libvtkHybrid.a(vtkImagePlaneWidget.o)(.text+0x7e6d):vtkImagePlaneWidget.cxx: undefined reference to `vtkPlaneSource::SetPoint2(float*)'
> /usr/local/src/MyCode/VTKbin/bin/libvtkHybrid.a(vtkImagePlaneWidget.o)(.text+0x8689): In function `vtkImagePlaneWidget::SetSliceIndex(int)':
> vtkImagePlaneWidget.cxx: undefined reference to `vtkPlaneSource::SetPoint1(float*)'
> /usr/local/src/MyCode/VTKbin/bin/libvtkHybrid.a(vtkImagePlaneWidget.o)(.text+0x86a2):vtkImagePlaneWidget.cxx: undefined reference to `vtkPlaneSource::SetPoint2(float*)'
> /usr/local/src/MyCode/VTKbin/bin/libvtkHybrid.a(vtkImagePlaneWidget.o)(.text+0x8a48): In function `vtkImagePlaneWidget::SetPoint1(float, float, float)':
> vtkImagePlaneWidget.cxx: undefined reference to `vtkPlaneSource::SetPoint1(float, float, float)'
> /usr/local/src/MyCode/VTKbin/bin/libvtkHybrid.a(vtkImagePlaneWidget.o)(.text+0x8a69): In function `vtkImagePlaneWidget::SetPoint1(float*)':
> vtkImagePlaneWidget.cxx: undefined reference to `vtkPlaneSource::SetPoint1(float*)'
> /usr/local/src/MyCode/VTKbin/bin/libvtkHybrid.a(vtkImagePlaneWidget.o)(.text+0x8ae8): In function `vtkImagePlaneWidget::SetPoint2(float, float, float)':
> vtkImagePlaneWidget.cxx: undefined reference to `vtkPlaneSource::SetPoint2(float, float, float)'
> /usr/local/src/MyCode/VTKbin/bin/libvtkHybrid.a(vtkImagePlaneWidget.o)(.text+0x8b09): In function `vtkImagePlaneWidget::SetPoint2(float*)':
> vtkImagePlaneWidget.cxx: undefined reference to `vtkPlaneSource::SetPoint2(float*)'
> /usr/local/src/MyCode/VTKbin/bin/libvtkHybrid.a(vtkImagePlaneWidget.o)(.text+0x96b8): In function `vtkImagePlaneWidget::vtkImagePlaneWidget()':
> vtkImagePlaneWidget.cxx: undefined reference to `vtkPlaneSource::New()'
> /usr/local/src/MyCode/VTKbin/bin/libvtkHybrid.a(vtkImagePlaneWidget.o)(.text+0x9784):vtkImagePlaneWidget.cxx: undefined reference to `vtkTextureMapToPlane::New()'
> /usr/local/src/MyCode/VTKbin/bin/libvtkHybrid.a(vtkImagePlaneWidget.o)(.text+0x9bb4): In function `vtkImagePlaneWidget::vtkImagePlaneWidget()':
> vtkImagePlaneWidget.cxx: undefined reference to `vtkPlaneSource::New()'
> /usr/local/src/MyCode/VTKbin/bin/libvtkHybrid.a(vtkImagePlaneWidget.o)(.text+0x9c80):vtkImagePlaneWidget.cxx: undefined reference to `vtkTextureMapToPlane::New()'
> /usr/local/src/MyCode/VTKbin/bin/libvtkRendering.a(vtkDataSetMapper.o)(.text+0x637): In function `vtkDataSetMapper::Render(vtkRenderer*, vtkActor*)':
> vtkDataSetMapper.cxx: undefined reference to `vtkDataSetSurfaceFilter::New()'
> /usr/local/src/MyCode/VTKbin/bin/libvtkRendering.a(vtkTextMapper.o)(.text+0x30): In function `vtkTextMapper::CollectRevisions(std::basic_ostream<char, std::char_traits<char> >&)':
> vtkTextMapper.cxx: undefined reference to `vtkMapper2D::CollectRevisions(std::basic_ostream<char, std::char_traits<char> >&)'/usr/local/src/MyCode/VTKbin/bin/libvtkRendering.a(vtkTextMapper.o)(.text+0x832): In function `vtkTextMapper::PrintSelf(std::basic_ostream<char, std::char_traits<char> >&, vtkIndent)':
> vtkTextMapper.cxx: undefined reference to `vtkMapper2D::PrintSelf(std::basic_ostream<char, std::char_traits<char> >&, vtkIndent)'
> /usr/local/src/MyCode/VTKbin/bin/libvtkRendering.a(vtkTextMapper.o)(.gnu.linkonce.r._ZTI13vtkTextMapper[typeinfo for vtkTextMapper]+0x8): undefined reference to `typeinfo for vtkMapper2D'
> /usr/local/src/MyCode/VTKbin/bin/libvtkRendering.a(vtkTextMapper.o)(.gnu.linkonce.t._ZN11vtkMapper2DC2Ev[vtkMapper2D::vtkMapper2D()]+0x16): In function `vtkMapper2D::vtkMapper2D()':
> vtkTextMapper.cxx: undefined reference to `vtable for vtkMapper2D'
> /usr/local/src/MyCode/VTKbin/bin/libvtkRendering.a(vtkTextMapper.o)(.gnu.linkonce.t._ZN11vtkMapper2DD2Ev[vtkMapper2D::~vtkMapper2D()]+0x7): In function `vtkMapper2D::~vtkMapper2D()':
> vtkTextMapper.cxx: undefined reference to `vtable for vtkMapper2D'
> /usr/local/src/MyCode/VTKbin/bin/libvtkRendering.a(vtkImageMapper.o)(.text+0x30): In function `vtkImageMapper::CollectRevisions(std::basic_ostream<char, std::char_traits<char> >&)':
> vtkImageMapper.cxx: undefined reference to `vtkMapper2D::CollectRevisions(std::basic_ostream<char, std::char_traits<char> >&)'
> /usr/local/src/MyCode/VTKbin/bin/libvtkRendering.a(vtkImageMapper.o)(.text+0x64e): In function `vtkImageMapper::PrintSelf(std::basic_ostream<char, std::char_traits<char> >&, vtkIndent)':
> vtkImageMapper.cxx: undefined reference to `vtkMapper2D::PrintSelf(std::basic_ostream<char, std::char_traits<char> >&, vtkIndent)'
> /usr/local/src/MyCode/VTKbin/bin/libvtkRendering.a(vtkImageMapper.o)(.gnu.linkonce.r._ZTI14vtkImageMapper[typeinfo for vtkImageMapper]+0x8): undefined reference to `typeinfo for vtkMapper2D'
> /usr/local/src/MyCode/VTKbin/bin/libvtkRendering.a(vtkPolyDataMapper2D.o)(.text+0x30): In function `vtkPolyDataMapper2D::CollectRevisions(std::basic_ostream<char, std::char_traits<char> >&)':
> vtkPolyDataMapper2D.cxx: undefined reference to `vtkMapper2D::CollectRevisions(std::basic_ostream<char, std::char_traits<char> >&)'
> /usr/local/src/MyCode/VTKbin/bin/libvtkRendering.a(vtkPolyDataMapper2D.o)(.text+0x1059): In function `vtkPolyDataMapper2D::PrintSelf(std::basic_ostream<char, std::char_traits<char> >&, vtkIndent)':
> vtkPolyDataMapper2D.cxx: undefined reference to `vtkMapper2D::PrintSelf(std::basic_ostream<char, std::char_traits<char> >&, vtkIndent)'
> /usr/local/src/MyCode/VTKbin/bin/libvtkRendering.a(vtkPolyDataMapper2D.o)(.gnu.linkonce.r._ZTI19vtkPolyDataMapper2D[typeinfo for vtkPolyDataMapper2D]+0x8): undefined reference to `typeinfo for vtkMapper2D'
> collect2: ld returned 1 exit status
> make[1]: *** [/usr/local/src/MyCode/VIP/EmbryomicsLocal] Error 1
> make: *** [default_target] Error 2
>

Cheers

-- 
Peter F Bradshaw, http://www.exadios.com
Public key at www.exadios.com/pfb.pgp.key and www.exadios.com/pfb.gpg.key
Personal site: http://personal.exadios.com
"I love truth, and the way the government still uses it occasionally to
 keep us guessing." - Sam Kekovich.



More information about the vtkusers mailing list