[vtkusers] undefined reference errors when compiling

Bill Lorensen bill.lorensen at gmail.com
Fri Mar 9 13:17:50 EST 2012


Try removing this line:
SET(VTK_LIBRARIES vtkRendering vtkCommon)

Depending on which version of VTK, this should be defined for you.

Bill

On Fri, Mar 9, 2012 at 8:15 AM, Yichuan GU <guyichuan at gmail.com> wrote:
> 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
>>
>>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>



-- 
Unpaid intern in BillsBasement at noware dot com



More information about the vtkusers mailing list