[vtkusers] 'Undefined Reference' Error Message

Jeremy Stout stout.jeremy at gmail.com
Wed Oct 20 15:17:21 EDT 2004


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
>



More information about the vtkusers mailing list