[vtkusers] 'Undefined Reference' Error Message

Mathieu Malaterre mathieu.malaterre at kitware.com
Wed Oct 20 15:29:27 EDT 2004


Jeremy,

	What is the output of:

nm libvtkParallel.so| c++filt| grep vtkMPIController::New
and
nm libvtkGraphics.so| c++filt| grep vtkConeSource::New

I get:

0016d0b6 T vtkMPIController::New()
0016ea3c W vtkMPIController::NewInstanceInternal() const

and

000c821e T vtkConeSource::New()
000c9604 W vtkConeSource::NewInstanceInternal() const

If you don't get anything, that mean you didn't build VTK properly, turn 
MPI on for example

HTH
Mathieu


Jeremy Stout wrote:
> Even when I use this command:
> 
> g++ translator.cpp -otranslator -I/usr/local/include/vtk
> -I/usr/local/packages/mpich/include -L/usr/local/lib/vtk/ -lvtkCommon
> -lvtkDICOMParser -lvtkParallel -lvtkIO -lvtkGraphics -lvtkFiltering
> -lvtkHybrid -lvtkImaging -lvtkRendering -lvtkexpat -lvtkfreetype
> -lvtkftgl -lvtkjpeg -lvtkpng -lvt
> ktiff -lvtkzlib -L/usr/local/packages/mpich/lib -lmpich -ldl
> 
> I get:
> 
> /tmp/ccPx6BGK.o(.text+0x11): In function `main':
> : undefined reference to `vtkMPIController::New()'
> /tmp/ccPx6BGK.o(.text+0x36): In function `main':
> : undefined reference to `vtkConeSource::New()'
> collect2: ld returned 1 exit status
> 
> I have no idea what is causing the error and I can't continue work on
> my program until I fix this. Thank you for your prompt response
> though.
> 
> Jeremy Stout
> 
> On Wed, 20 Oct 2004 14:19:32 -0400, tom fogal <tfogal at apollo.sr.unh.edu> wrote:
> 
>><a6bc6cc04102007277b92dab4 at mail.gmail.com>Jeremy Stout writes:
>>
>>>Hello, I am trying to compile a VTK program with the following line:
>>>
>>>g++ translator.cpp -otranslator -I/usr/local/include/vtk
>>>-I/usr/local/packages/mpich/include -L /usr/local/
>>>lib/vtk/ -lvtkParallel  -L /usr/local/packages/mpich/lib -lmpich -ldl
>>
>>This is valid? I guess you learn something new everyday. I had always
>>though you could not have a space between -L and its argument, but you
>>seem to be using it and not getting link errors due to mpich...
>>
>>
>>>Unfortunately, this results in the following error messages:
>>
>><snip>
>>
>>>/tmp/ccZVONeC.o(.text+0x11): In function `main':
>>>: undefined reference to `vtkMPIController::New()'
>>>/tmp/ccZVONeC.o(.text+0x36): In function `main':
>>>: undefined reference to `vtkConeSource::New()'
>>
>>You're forgetting to link in a library, my guess is vtkCommon. add in
>>'-lvtkCommon' to your link line and see if that fixes it. I wouldve
>>thought vtkMPIController would be in vtkParallel though...
>>
>>HTH,
>>
>>-tom
>>
> 
> _______________________________________________
> This is the private VTK discussion list. 
> Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
> 






More information about the vtkusers mailing list