[vtkusers] what`s wrong, my code or the Cmake file?

Baofen Yang yangbaofen at hotmail.com
Wed Mar 19 19:21:51 EST 2003


Hi all,
I wrote a very simple code to visualize a cube I defined
by myself. the data file name is myFile.vtk.
When I run the code for this, I encountered compiling
problem. it always said: error LNK2001:
unresolved external symbol "__declspec(dllimport) public: class vtkPolyData 
* .....
I don't where is the problem, so I copy my code and the
cmake file here:
vtkPolyDataReader *cone = vtkPolyDataReader::New();
	cone -> SetFileName("mySampleFile.vtk");
	cone -> Update();
vtkPolyDataMapper *coneMapper = vtkPolyDataMapper::New);
  coneMapper->SetInput( cone->GetOutput() );
vtkActor *coneActor = vtkActor::New();
  coneActor->SetMapper( coneMapper );
....

the CMake file CMakeLists.txt:
PROJECT (myTest2)
INCLUDE (${CMAKE_ROOT}/Modules/FindVTK.cmake)
IF (USE_VTK_FILE)
  INCLUDE(${USE_VTK_FILE})
ENDIF (USE_VTK_FILE)
ADD_EXECUTABLE(myTest2 myTest2.cpp)
TARGET_LINK_LIBRARIES(myTest2 vtkRendering)



Thanks very much for any help!!!









_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE*  
http://join.msn.com/?page=features/virus




More information about the vtkusers mailing list