[vtkusers] VTKPolyData to 3D image

David Welch dmwelch at engineering.uiowa.edu
Tue Apr 20 11:55:39 EDT 2010


This is my CMake file:


PROJECT(SurfaceToImage) # Project name
CMAKE_MINIMUM_REQUIRED( VERSION 2.6) # This is the minimum version of CMake
#*******************************************************************************

FIND_PACKAGE(VTK REQUIRED)
IF (VTK_FOUND)
  INCLUDE(${VTK_USE_FILE})
ELSE (VTK_FOUND)
  MESSAGE(ERROR "Cannot build without a VTK build tree or a VTK
installation. Please set VTK_DIR.")
ENDIF (VTK_FOUND)
#*******************************************************************************

SET( SurfaceToImage_SOURCE SurfaceToImage.cxx )
ADD_LIBRARY(SurfaceToImageLib SHARED ${SurfaceToImage_SOURCE})
SET_TARGET_PROPERTIES (SurfaceToImageLib PROPERTIES COMPILE_FLAGS
"-Dmain=ModuleEntryPoint")
TARGET_LINK_LIBRARIES (SurfaceToImageLib vtkIO vtkFiltering vtkCommon
vtkImaging)
ADD_EXECUTABLE( SurfaceToImage ${SurfaceToImage_SOURCE})
TARGET_LINK_LIBRARIES (SurfaceToImage vtkIO vtkCommon vtkFiltering
vtkImaging)
#*******************************************************************************

On Tue, Apr 20, 2010 at 10:48 AM, David Doria
<daviddoria+vtk at gmail.com<daviddoria%2Bvtk at gmail.com>
> wrote:

> On Tue, Apr 20, 2010 at 11:45 AM, David Welch
> <dmwelch at engineering.uiowa.edu> wrote:
> > Okay, I'm in the home stretch here... I've changed the code slightly to
> > output a XMLImageData file and take an input surface.  CMake runs fine on
> > it, but it dies in the make process with this error:
> >
> > CMakeFiles/SurfaceToImage.dir/SurfaceToImage.cxx.o: In function
> > `vtkSmartPointer<vtkPolyDataToImageStencil>::New()':
> > /usr/local/include/vtk-5.7/vtkSmartPointer.h:113: undefined reference to
> > `vtkPolyDataToImageStencil::New()'
> >
> > The smart pointer line is fundamentally no different than any other line
> of
> > code.  ???  Here's my code:
>
> Are you linking to vtkHybrid (that is where
> vtkPolyDataToImageStencil.cxx lives) ? What does your CMakeLists.txt
> file look like?
>
> Thanks,
>
> David
>



-- 
David Welch
Graduate Student
Dept. of Biomedical Engineering
University of Iowa
Lab: (319) 335-5279
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100420/767f33f6/attachment.htm>


More information about the vtkusers mailing list