[vtkusers] Problem with compiling and linking static libraries
Cally K
kalpana0611 at gmail.com
Thu May 29 00:05:59 EDT 2008
this is the error
vtkVolumeProperty.cxx:(.text+0x1a81): undefined reference to
`vtkColorTransferFunction::New()'
vtkVolumeProperty.cxx:(.text+0x1afb): undefined reference to
`vtkColorTransferFunction::AddRGBPoint(double, double, double, double)'
vtkVolumeProperty.cxx:(.text+0x1b29): undefined reference to
`vtkColorTransferFunction::AddRGBPoint(double, double, double, double)'
and so much more... all about undefined reference,
and when I try using the libraries in VTKbuild/bin
linked them this way --
g++ -o Cone Cone.o
-I/home/kalpanak/Installation_Files/VTKProject/VTKbuildprefix/include/vtk-5.0
-L/home/kalpanak/Installation_Files/VTKProject/VTKbuildprefix/lib -lGL -lGLU
-L/home/kalpanak/Installation_Files/VTKProject/VTKbuild/bin/libvtkCommon.a
-L/home/kalpanak/Installation_Files/VTKProject/VTKbuild/bin/libvtkFiltering.a
-L/home/kalpanak/Installation_Files/VTKProject/VTKbuild/bin/libvtkGraphics.a
-L/home/kalpanak/Installation_Files/VTKProject/VTKbuild/bin/libvtkIO.a
-L/home/kalpanak/Installation_Files/VTKProject/VTKbuild/bin/libvtkRendering.a
-L/home/kalpanak/Installation_Files/VTKProject/VTKbuild/bin/libvtkVolumeRendering.a
-L/home/kalpanak/Installation_Files/VTKProject/VTKbuild/bin/libvtkGenericFiltering.a
-L/home/kalpanak/Installation_Files/VTKProject/VTKbuild/bin/libvtkHybrid.a
-L/home/kalpanak/Installation_Files/VTKProject/VTKbuild/bin/libvtkImaging.a
I get this error
Cone.o: In function `main':
Cone.cxx:(.text+0x87): undefined reference to `vtkConeSource::New()'
Cone.cxx:(.text+0xe3): undefined reference to `vtkPolyDataMapper::New()'
Cone.cxx:(.text+0x10e): undefined reference to `vtkActor::New()'
Cone.cxx:(.text+0x131): undefined reference to `vtkRenderer::New()'
Cone.cxx:(.text+0x146): undefined reference to
`vtkRenderer::AddActor(vtkProp*)'
Cone.cxx:(.text+0x17b): undefined reference to `vtkRenderWindow::New()'
Cone.cxx:(.text+0x1e5): undefined reference to
`vtkRenderer::GetActiveCamera()'
Cone.cxx:(.text+0x1f3): undefined reference to `vtkCamera::Azimuth(double)'
Cone.o: In function `vtkAlgorithm::GetOutputPort()':
Cone.cxx:(.gnu.linkonce.t._ZN12vtkAlgorithm13GetOutputPortEv+0x15):
undefined reference to `vtkAlgorithm::GetOutputPort(int)'
collect2: ld returned 1 exit status
On 5/28/08, Amy Squillacote <ahs at cfdrc.com> wrote:
>
> What is the error message you are getting?
>
> - Amy
>
> Cally K wrote:
>
>> Hi everyone,
>>
>> I tried searching the mailing list and I found out ways to compile and
>> link vtk examples ( Cone.cxx ) . I managed to do it when VTK was built
>> using the shared library option
>>
>> But I need to run VTK on the cluster, parallel VTK. and I need to
>> build static libraries as I am not root, I compiled it, but it is the
>> linking that is giving problem,
>>
>> this is my command to compile
>> a) g++ -c
>> -I/home/kalpanak/Installation_Files/VTKProject/VTKbuildprefix/include/vtk-5.0
>> Cone.cxx -Wno-deprecated
>>
>> to link
>> b) g++ -o Cone Cone.o
>>
>> -I/home/kalpanak/Installation_Files/VTKProject/VTKbuildprefix/include/vtk-5.0
>> -L/home/kalpanak/Installation_Files/VTKProject/VTKbuildprefix/lib
>>
>> /home/kalpanak/Installation_Files/VTKProject/VTKbuildprefix/lib/libvtkFiltering.a
>>
>> /home/kalpanak/Installation_Files/VTKProject/VTKbuildprefix/lib/libvtkCommon.a
>>
>> L/home/kalpanak/Installation_Files/VTKProject/VTKbuildprefix/lib/libvtkGraphics.a
>>
>> L/home/kalpanak/Installation_Files/VTKProject/VTKbuildprefix/lib/libvtkIO.a
>>
>>
>> my lib folder is in
>> /home/kalpanak/Installation_Files/VTKProject/VTKbuildprefix/lib, and I
>> can see all the libvtkFiltering. a libvtkCommon.a all
>>
>> what am I doing wrong, please help...
>> _______________________________________________
>> This is the private VTK discussion list.
>> Please keep messages on-topic. Check the FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>>
>>
>>
>>
>
> --
> Amy Squillacote Phone: (256) 726-4839
> Computer Scientist Fax: (256) 726-4806
> CFD Research Corporation Web: http://www.cfdrc.com
> 215 Wynn Drive, Suite 501
> Huntsville, AL 35805
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20080529/5836b049/attachment.htm>
More information about the vtkusers
mailing list