[vtkusers] Undefined reference error while compiling with VTK shared libraries in Ubuntu 16.04

Dan Lipsa dan.lipsa at kitware.com
Thu Nov 3 15:13:22 EDT 2016

It seems that you are reading libraries from your own
VTK: -L/home/sthomas/projects/VTK-build/lib
but the headers are from the system installed
VTK: /usr/local/include/vtk-6.3/

I suggest uninstalling the system VTK or make sure that the correct headers
are picked up by LAMMPS.

On Thu, Nov 3, 2016 at 2:47 PM, Stephen Thomas <
stephenthomas1 at boisestate.edu> wrote:

> Hi,
> I am trying to build a C++ code called LAMMPS which uses VTK for writing
> vtk files. I am getting errors that seem like linking errors. I am able to
> compile VTK successfully, but when I compile the LAMMPS code, I get the
> following errors from the line
> vtkSmartPointer<vtkXMLPolyDataWriter> writer = vtkSmartPointer<
> vtkXMLPolyDataWriter>::New();
> :
> mpicxx -g -O  -L/home/sthomas/projects/VTK-build/lib   dump_custom_vtk.o
> ..........................................  -lvtkCommonCore-6.3
> -lvtkIOCore-6.3 -lvtkIOXML-6.3 -lvtkIOLegacy-6.3 -lvtkCommonDataModel-6.3
> -lblas -llapack   -o ../lmp_mpi
> dump_custom_vtk.o: In function `vtkSmartPointer<vtkXMLPPolyDa
> taWriter>::New()':
> /usr/local/include/vtk-6.3/vtkSmartPointer.h:117: undefined reference to
> `vtkXMLPPolyDataWriter::New()'
> dump_custom_vtk.o: In function `vtkSmartPointer<vtkXMLPUnstru
> cturedGridWriter>::New()':
> /usr/local/include/vtk-6.3/vtkSmartPointer.h:117: undefined reference to
> `vtkXMLPUnstructuredGridWriter::New()'
> collect2: error: ld returned 1 exit status
> This is the first time I am writing to this forum. I may be missing some
> supporting information. Please let me know if more information is required.
> I must also point out that I have another code installed on the machine
> which has also installed VTK 7.0 and its shared libraries. I am not sure if
> these are somehow interfering. I am assuming that the -L/path_to_lib as
> seen above should take care of pointing to the right libraries.
> Thank you,
> Stephen Thomas.
> _______________________________________________
> 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
> Search the list archives at: http://markmail.org/search/?q=vtkusers
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20161103/0c5b1cd5/attachment.html>

More information about the vtkusers mailing list