[vtkusers] undefined reference errors when compiling

Yichuan GU guyichuan at gmail.com
Fri Mar 9 11:15:02 EST 2012


Anyone know how to fix this problem?


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


More information about the vtkusers mailing list