[vtkusers] Re: Problem moving from win to linux
Matteo Campana
campanam at libero.it
Mon May 29 09:05:13 EDT 2006
Hi Peter
Thank you for your reply.
In CMakeList I wrote LINK_LIBRARIES(vtkHybrid vtkGraphics).......everything
works now!
I just find it strange....I use static libraries also in Windows and i don't
need to write any LINK_LIBRARIES command in CMakeList...(I use VisualStudio
6.0 )
I only used the TARGET_LINK_LIBRARIES command
The CMakeList file looks like:
.
.
TARGET_LINK_LIBRARIES( EmbryomicsTool
AuxiliaryLibrary VIPframeworkLibrary ModulesLibrary ComponentsLibrary
ITKAlgorithms ITKBasicFilters ITKCommon ITKIO ITKNumerics
vtkRendering vtkGraphics vtkHybrid vtkImaging vtkIO vtkFiltering vtkCommon
vtkParallel
${FLTK_LIBRARIES})
.
.
In Linux I also have to explicitly link the 2 libraries by LINK_LIBRARIES.
Anyway...Thank You so much!!
Matteo
> 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.
>
>
> 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.
More information about the vtkusers
mailing list