[vtkusers] Undefined reference when compiling

Sara Rolfe smrolfe at u.washington.edu
Wed Apr 18 12:26:57 EDT 2012


Thanks for your help!  I had added this before and when I tried to  
rebuild it I realized the link had been lost when I updated cmake.   
The problem is solved now.

Thanks,
Sara


On Apr 17, 2012, at 2:05 PM, David Doria wrote:

> On Tue, Apr 17, 2012 at 3:41 PM, Sara Rolfe  
> <smrolfe at u.washington.edu> wrote:
>> Hello,
>>
>> I recently updated cmake to version 2.8.7 and when I went to  
>> recompile a
>> program that I have built successfully before, I got the following  
>> linking
>> error:
>>
>> CMakeFiles/SurfaceVectorFilter.dir/SurfaceVectorFilter.cxx.o: In  
>> function
>> `vtkSmartPointer<vtkPointSetNormalEstimationFilter>::New()':
>>
>> SurfaceVectorFilter.cxx: 
>> (.text 
>> ._ZN15vtkSmartPointerI33vtkPointSetNormalEstimationFilterE3NewEv 
>> [vtkSmartPointer<vtkPointSetNormalEstimationFilter>::New()]+0x12):
>> undefined reference to `vtkPointSetNormalEstimationFilter::New()'
>> collect2: ld returned 1 exit status
>> make[2]: *** [SurfaceVectorFilter] Error 1
>> make[1]: *** [CMakeFiles/SurfaceVectorFilter.dir/all] Error 2
>> make: *** [all] Error 2
>>
>>
>> I checked that the cmake file has the correct path to VTK.  Could  
>> you please
>> let me know if you have any advice?  Is it possible that I need to  
>> rebuild
>> VTK with my new version of cmake?  I am also using ITK and it is  
>> working
>> just fine.
>>
>> Thanks,
>> Sara
>
> I don't know which version of the code you're using. Does it have the
>
> vtkTypeMacro(vtkPointSetNormalEstimation, vtkPolyDataAlgorithm);
>
> as it does here:
>
> https://github.com/daviddoria/PointSetProcessing/blob/master/vtkPointSetNormalEstimation.h
>
> A long time ago (probably at the time the VTK Journal version of the
> code was written) this used to be a different macro and could
> potentially cause this sort of error when using a recent VTK.
>
> I would try building this:
> https://github.com/daviddoria/PointSetProcessing
>
> and let us know if you get the same error.
>
> David




More information about the vtkusers mailing list