[vtkusers] need help in using vtkPolyDataReader

Martin Dunschen zabaione at uk2.net
Wed Mar 3 02:14:26 EST 2004


Where is vtkIO.lib? Make sure it is in your library serch path. You set 
the lib search path either from project settings just form this 
project, or from tools->options, I think the directories tab.

Then you also need to copy the DLL into the same directory as the 
executable... can be done as a post build step, in project settings

look further up, another user had a similar problem
On Wednesday, Mar 3, 2004, at 03:38 Europe/London, Dan Lee wrote:

> Dear vtk users,
>  
>    I'm new in using vtk. When I tried to use vtkPolyDataReader to 
> input .vtk format data in an exercise, I run into trouble and  got 
> following compiling problem:
>  
> --------------------Configuration: StrSph2 - Win32 
> Debug--------------------
> Linking...
> StrSph2.obj : error LNK2001: unresolved external symbol 
> "__declspec(dllimport) public: class vtkPolyData * __thiscall 
> vtkPolyDataReader::GetOutput(void)" 
> (__imp_?GetOutput at vtkPolyDataReader@@QAEPAVvtkPolyData@@XZ)
> StrSph2.obj : error LNK2001: unresolved external symbol 
> "__declspec(dllimport) public: static class vtkPolyDataReader * 
> __cdecl vtkPolyDataReader::New(void)" 
> (__imp_?New at vtkPolyDataReader@@SAPAV1 at XZ)
> Debug/StrSph2.exe : fatal error LNK1120: 2 unresolved externals
> Error executing link.exe.
> ALL_BUILD - 3 error(s), 0 warning(s)
>  
> My code is following. Any help is highly appreciated.
>  
> Thanks.
>  
> Dan
>  
>  
> #include "vtkRenderer.h"
> #include "vtkRenderWindow.h"
> #include "vtkRenderWindowInteractor.h"
> #include "vtkSphereSource.h"
> #include "vtkPolyDataReader.h"
> #include "vtkElevationFilter.h"
> #include "vtkLookupTable.h"
> #include "vtkDataSetMapper.h"
> #include "vtkActor.h"
> void main ()
> {
>   vtkRenderer *renderer = vtkRenderer::New();
>   vtkRenderWindow *renWin = vtkRenderWindow::New();
>     renWin->AddRenderer(renderer);
>   vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();
>     iren->SetRenderWindow(renWin);
>  
>  
>   vtkPolyDataReader *polydata = vtkPolyDataReader::New();
>     polydata->SetFileName("honolulu.vtk");
>    
>   vtkElevationFilter *colorIt = vtkElevationFilter::New();
>   colorIt->SetInput((vtkDataSet *)polydata->GetOutput());
>     colorIt->SetLowPoint(0,0,-1);
>     colorIt->SetHighPoint(0,0,1);
>   vtkLookupTable *lut = vtkLookupTable::New();
>     lut->SetHueRange(0,0);
>     lut->SetSaturationRange(0,0);
>     lut->SetValueRange(.1,1);
>   vtkDataSetMapper *mapper = vtkDataSetMapper::New();
>     mapper->SetLookupTable(lut);
>     mapper->SetInput(colorIt->GetOutput());
>   vtkActor *actor = vtkActor::New();
>     actor->SetMapper(mapper);
>   renderer->AddActor(actor);
>   renderer->SetBackground(1,1,1);
>   renWin->SetSize(450,450);
>   renWin->Render();
>   // interact with data
>   iren->Start();
>   // Clean up
>   renderer->Delete();
>   renWin->Delete();
>   iren->Delete();
>   colorIt->Delete();
>   lut->Delete();
>   mapper->Delete();
>   actor->Delete();
> }
>  
>
>
>
<image.tiff>
>
> Do you Yahoo!?
> Yahoo! Search - Find what youíre looking for faster.



More information about the vtkusers mailing list