Anyone know how to fix this problem?<br><br><br>在 2012年3月7日星期三,Yichuan GU <<a href="mailto:guyichuan@gmail.com">guyichuan@gmail.com</a>> 写道:<br>> Thanks for reponding.<br>> Yes, I think there is ${VTK_LIBRARIES} in the CMakeLists.txt Here is the part withs VTK in the CMakeLists.txt file :<br>
><br>> OPTION(WITH_VTK "Set to OFF to build without VTK" ON )<br>><br>> IF (WITH_VTK)<br>><br>> FIND_PACKAGE(VTK REQUIRED)<br>><br>> IF (VTK_FOUND)<br>><br>> INCLUDE (${VTK_USE_FILE})<br>
><br>> SET(VTK_LIBRARIES vtkRendering vtkCommon)<br>><br>> ENDIF (VTK_FOUND)<br>><br>> ENDIF (WITH_VTK)<br>><br>> and<br>><br>> IF (WITH_PETSC)<br>><br>> SET(LIBS<br>><br>> ${VTK_LIBRARIES} <br>
><br>> scopi blas lapack cblas slu voro++<br>><br>> ${PETSC_LIBRARIES} ${FFTW_LIBRARIES} StokesPartLib<br>><br>> )<br>><br>> ELSE ()<br>><br>> SET(LIBS<br>><br>> On Tue, Mar 6, 2012 at 9:56 PM, John Drescher <<a href="mailto:drescherjm@gmail.com">drescherjm@gmail.com</a>> wrote:<br>
>><br>>> On Tue, Mar 6, 2012 at 3:52 PM, Yichuan GU <<a href="mailto:guyichuan@gmail.com">guyichuan@gmail.com</a>> wrote:<br>>> > Hello,<br>>> ><br>>> > I'm new to vtk. Actually i try to compile a particle modeling software<br>
>> > written by our professor with vtk components and i met several undefined<br>>> > reference errors:<br>>> ><br>>> >>> Linking CXX executable bin/gmc.out<br>>> >>><br>
>> >>> lib/libscopi.a(Out_VTK.o): In function `Out_VTK::plot(int)':<br>>> >>><br>>> >>> Out_VTK.cpp:(.text+0x98c): undefined reference to<br>>> >>> `vtkPolyDataMapper::New()'<br>
>> >>><br>>> >>> Out_VTK.cpp:(.text+0x9c6): undefined reference to `vtkLODActor::New()'<br>>> >>><br>>> > How can i fix this problem ? Thanks a lot !!<br>>> ><br>
>><br>>> Make sure you have ${VTK_LIBRARIES} in your target_link_libraries for<br>>> your target in your CMakeLists.txt file for your project.<br>>><br>>> John<br>><br>>