I’m trying to use VTK static lib in QT Creator, but got so many compile error(> 2000), if I compile the same program with VTK dynamic lib, no error and the program works well.
/home/edward/workings/vtk/vtk-static/lib/libvtkCommonColor-8.2.a(vtkNamedColors.cxx.o): In function vtkNamedColors::GetColorNames(vtkStringArray*)': /home/edward/workings/vtk/VTK-8.2.0/Common/Color/vtkNamedColors.cxx:1027: undefined reference tovtkStringArray::InsertNextValue(vtkStdString)’
/home/edward/workings/vtk/vtk-static/lib/libvtkCommonExecutionModel-8.2.a(vtkAlgorithm.cxx.o): In function vtkAlgorithm::vtkAlgorithm()': /home/edward/workings/vtk/VTK-8.2.0/Common/ExecutionModel/vtkAlgorithm.cxx:94: undefined reference tovtkInformationVector::New()’
/home/edward/workings/vtk/VTK-8.2.0/Common/ExecutionModel/vtkAlgorithm.cxx:95: undefined reference to vtkInformationVector::New()' /home/edward/workings/vtk/VTK-8.2.0/Common/ExecutionModel/vtkAlgorithm.cxx:97: undefined reference tovtkInformation::New()’
/home/edward/workings/vtk/vtk-static/lib/libvtkCommonExecutionModel-8.2.a(vtkAlgorithm.cxx.o): In function `vtkAlgorithm::GetInputArrayFieldInformation(int, vtkInformationVector**)’:
The linker thinks you’re not. The order of the libraries also matters for static linking on Linux. Could you paste the full link line that is being used?
Hi, Edward!
I have the same problems as you got. And I have no idea about the rank levels of the all VTK static libraries. Can you tell me the method of making this ranking list?
The easiest is to just use CMake as it will order things properly. The most reliable way is to have CMake generate a project that links to the libraries you want and to grab the order from the link line.