undefined reference to `vnl_vector<T>::~vnl_vector()'

Dear All,

I moved this question from my email to insight-users@itk.org to this forum as suggested by Dženan. The original content (sent to insight-users@itk.org) was copied below. Dženan asked whether I used CMake to configure the compiler for the read-image-file code.

I used the following CMake file and set ITK_DIR in ccmake to /path/to/ITK-build-release with the same compilation setting as the compiler setting for building the ITK library with
CMAKE_CXX_COMPILER /usr/lib64/ccache/c++
CMAKE_CXX_FLAGS -std=c++11 -pthread
CMAKE_EXE_LINKER_FLAGS -pthread
After configuring and generating using ccmake, I call ‘make’ to compile and build the code.

Would anyone know why I get this error or how could I fix this error?

Thank you very much for your time and help

Best regads,

Ja

#- CMake file
cmake_minimum_required(VERSION 2.8)

project(read_image)

find_package(ITK REQUIRED)
include(${ITK_USE_FILE})

add_executable(test_read_image test_read_image.cxx)
target_link_libraries(test_read_image ${ITK_LIBRARIES})

#-Content in the original email

I have a problem compiling a simple read-image-file code below in Fedora, after I build ITK 4.12.1 from source code downloaded from the ITK website. I did not receive any error for compiling ITK. For compilation of ITK 4.12.1, I did not change the default CMake options of the ITK library, and the CMake options for compilation were set as

CMAKE_CXX_COMPILER /usr/lib64/ccache/c++
CMAKE_CXX_FLAGS -std=c++11 -pthread
CMAKE_EXE_LINKER_FLAGS -pthread

The error, from compiling the read-image-file code below, was all “undefined reference to ‘vnl_vector::~vnl_vector()’” with some data types T including long long, short, unsigned char, etc. I attached the file containing the error (std::cerr from ‘make’ command for single-thread compilation) to this email.

// Code
#include “itkImageFileReader.h”

int main()
{
typedef itk::Image<float, 2> ImageType;
typedef itk::ImageFileReader ImageFileReaderType;
ImageFileReaderType::Pointer reader = ImageFileReaderType::New();
reader->SetFileName(“some_image_filename”);
reader->Update();

ImageType::Pointer image = reader->GetOutput();

return EXIT_SUCCESS;
}

Here is the part of the error I got. I cannot put all the error in due to the character limit of the forum.

/home/ja/dev/ITK/build-release/lib/libITKIOGDCM-4.12.a(itkGDCMImageIO.cxx.o): In function itk::GDCMImageIO::Write(void const*)': itkGDCMImageIO.cxx:(.text+0x53c6): undefined reference toitksysBase64_Decode’
/home/ja/dev/ITK/build-release/lib/libITKIOHDF5-4.12.a(itkHDF5ImageIO.cxx.o): In function itk::MetaDataObject<itk::Array<long long> >::~MetaDataObject()': itkHDF5ImageIO.cxx:(.text._ZN3itk14MetaDataObjectINS_5ArrayIxEEED2Ev[_ZN3itk14MetaDataObjectINS_5ArrayIxEEED5Ev]+0x32): undefined reference tovnl_vector::~vnl_vector()’
/home/ja/dev/ITK/build-release/lib/libITKIOHDF5-4.12.a(itkHDF5ImageIO.cxx.o): In function itk::MetaDataObject<itk::Array<unsigned long long> >::~MetaDataObject()': itkHDF5ImageIO.cxx:(.text._ZN3itk14MetaDataObjectINS_5ArrayIyEEED2Ev[_ZN3itk14MetaDataObjectINS_5ArrayIyEEED5Ev]+0x32): undefined reference tovnl_vector::~vnl_vector()’
/home/ja/dev/ITK/build-release/lib/libITKIOHDF5-4.12.a(itkHDF5ImageIO.cxx.o): In function itk::MetaDataObject<itk::Array<unsigned long> >::~MetaDataObject()': itkHDF5ImageIO.cxx:(.text._ZN3itk14MetaDataObjectINS_5ArrayImEEED2Ev[_ZN3itk14MetaDataObjectINS_5ArrayImEEED5Ev]+0x32): undefined reference tovnl_vector::~vnl_vector()’
/home/ja/dev/ITK/build-release/lib/libITKIOHDF5-4.12.a(itkHDF5ImageIO.cxx.o): In function itk::MetaDataObject<itk::Array<unsigned int> >::~MetaDataObject()': itkHDF5ImageIO.cxx:(.text._ZN3itk14MetaDataObjectINS_5ArrayIjEEED2Ev[_ZN3itk14MetaDataObjectINS_5ArrayIjEEED5Ev]+0x32): undefined reference tovnl_vector::~vnl_vector()’
/home/ja/dev/ITK/build-release/lib/libITKIOHDF5-4.12.a(itkHDF5ImageIO.cxx.o): In function itk::MetaDataObject<itk::Array<unsigned char> >::~MetaDataObject()': itkHDF5ImageIO.cxx:(.text._ZN3itk14MetaDataObjectINS_5ArrayIhEEED2Ev[_ZN3itk14MetaDataObjectINS_5ArrayIhEEED5Ev]+0x32): undefined reference tovnl_vector::~vnl_vector()’
/home/ja/dev/ITK/build-release/lib/libITKIOHDF5-4.12.a(itkHDF5ImageIO.cxx.o): In function itk::MetaDataObject<itk::Array<short> >::~MetaDataObject()': itkHDF5ImageIO.cxx:(.text._ZN3itk14MetaDataObjectINS_5ArrayIsEEED2Ev[_ZN3itk14MetaDataObjectINS_5ArrayIsEEED5Ev]+0x32): undefined reference tovnl_vector::~vnl_vector()’
/home/ja/dev/ITK/build-release/lib/libITKIOHDF5-4.12.a(itkHDF5ImageIO.cxx.o): In function itk::MetaDataObject<itk::Array<unsigned short> >::~MetaDataObject()': itkHDF5ImageIO.cxx:(.text._ZN3itk14MetaDataObjectINS_5ArrayItEEED2Ev[_ZN3itk14MetaDataObjectINS_5ArrayItEEED5Ev]+0x32): undefined reference tovnl_vector::~vnl_vector()’
/home/ja/dev/ITK/build-release/lib/libITKIOHDF5-4.12.a(itkHDF5ImageIO.cxx.o): In function itk::MetaDataObject<itk::Array<unsigned long long> >::~MetaDataObject()': itkHDF5ImageIO.cxx:(.text._ZN3itk14MetaDataObjectINS_5ArrayIyEEED0Ev[_ZN3itk14MetaDataObjectINS_5ArrayIyEEED0Ev]+0x32): undefined reference tovnl_vector::~vnl_vector()’
/home/ja/dev/ITK/build-release/lib/libITKIOHDF5-4.12.a(itkHDF5ImageIO.cxx.o): In function itk::MetaDataObject<itk::Array<long long> >::~MetaDataObject()': itkHDF5ImageIO.cxx:(.text._ZN3itk14MetaDataObjectINS_5ArrayIxEEED0Ev[_ZN3itk14MetaDataObjectINS_5ArrayIxEEED0Ev]+0x32): undefined reference tovnl_vector::~vnl_vector()’
/home/ja/dev/ITK/build-release/lib/libITKIOHDF5-4.12.a(itkHDF5ImageIO.cxx.o): In function itk::MetaDataObject<itk::Array<short> >::~MetaDataObject()': itkHDF5ImageIO.cxx:(.text._ZN3itk14MetaDataObjectINS_5ArrayIsEEED0Ev[_ZN3itk14MetaDataObjectINS_5ArrayIsEEED0Ev]+0x32): undefined reference tovnl_vector::~vnl_vector()’
/home/ja/dev/ITK/build-release/lib/libITKIOHDF5-4.12.a(itkHDF5ImageIO.cxx.o): In function itk::MetaDataObject<itk::Array<unsigned char> >::~MetaDataObject()': itkHDF5ImageIO.cxx:(.text._ZN3itk14MetaDataObjectINS_5ArrayIhEEED0Ev[_ZN3itk14MetaDataObjectINS_5ArrayIhEEED0Ev]+0x32): undefined reference tovnl_vector::~vnl_vector()’
/home/ja/dev/ITK/build-release/lib/libITKIOHDF5-4.12.a(itkHDF5ImageIO.cxx.o): In function itk::MetaDataObject<itk::Array<unsigned int> >::~MetaDataObject()': itkHDF5ImageIO.cxx:(.text._ZN3itk14MetaDataObjectINS_5ArrayIjEEED0Ev[_ZN3itk14MetaDataObjectINS_5ArrayIjEEED0Ev]+0x32): undefined reference tovnl_vector::~vnl_vector()’
/home/ja/dev/ITK/build-release/lib/libITKIOHDF5-4.12.a(itkHDF5ImageIO.cxx.o): In function itk::MetaDataObject<itk::Array<unsigned long> >::~MetaDataObject()': itkHDF5ImageIO.cxx:(.text._ZN3itk14MetaDataObjectINS_5ArrayImEEED0Ev[_ZN3itk14MetaDataObjectINS_5ArrayImEEED0Ev]+0x32): undefined reference tovnl_vector::~vnl_vector()’
/home/ja/dev/ITK/build-release/lib/libITKIOHDF5-4.12.a(itkHDF5ImageIO.cxx.o): In function itk::MetaDataObject<itk::Array<unsigned short> >::~MetaDataObject()': itkHDF5ImageIO.cxx:(.text._ZN3itk14MetaDataObjectINS_5ArrayItEEED0Ev[_ZN3itk14MetaDataObjectINS_5ArrayItEEED0Ev]+0x32): undefined reference tovnl_vector::~vnl_vector()’
/home/ja/dev/ITK/build-release/lib/libITKIOHDF5-4.12.a(itkHDF5ImageIO.cxx.o): In function bool itk::HDF5ImageIO::WriteMetaArray<unsigned long>(std::string const&, itk::MetaDataObjectBase*)': itkHDF5ImageIO.cxx:(.text._ZN3itk11HDF5ImageIO14WriteMetaArrayImEEbRKSsPNS_18MetaDataObjectBaseE[_ZN3itk11HDF5ImageIO14WriteMetaArrayImEEbRKSsPNS_18MetaDataObjectBaseE]+0x42): undefined reference tovnl_vector::vnl_vector(vnl_vector const&)‘
itkHDF5ImageIO.cxx:(.text._ZN3itk11HDF5ImageIO14WriteMetaArrayImEEbRKSsPNS_18MetaDataObjectBaseE[_ZN3itk11HDF5ImageIO14WriteMetaArrayImEEbRKSsPNS_18MetaDataObjectBaseE]+0x1a3): undefined reference to vnl_vector<unsigned long>::~vnl_vector()' itkHDF5ImageIO.cxx:(.text._ZN3itk11HDF5ImageIO14WriteMetaArrayImEEbRKSsPNS_18MetaDataObjectBaseE[_ZN3itk11HDF5ImageIO14WriteMetaArrayImEEbRKSsPNS_18MetaDataObjectBaseE]+0x20a): undefined reference tovnl_vector::~vnl_vector()’
/home/ja/dev/ITK/build-release/lib/libITKIOHDF5-4.12.a(itkHDF5ImageIO.cxx.o): In function bool itk::HDF5ImageIO::WriteMetaArray<char>(std::string const&, itk::MetaDataObjectBase*)': itkHDF5ImageIO.cxx:(.text._ZN3itk11HDF5ImageIO14WriteMetaArrayIcEEbRKSsPNS_18MetaDataObjectBaseE[_ZN3itk11HDF5ImageIO14WriteMetaArrayIcEEbRKSsPNS_18MetaDataObjectBaseE]+0x47): undefined reference tovnl_vector::vnl_vector(vnl_vector const&)‘
itkHDF5ImageIO.cxx:(.text._ZN3itk11HDF5ImageIO14WriteMetaArrayIcEEbRKSsPNS_18MetaDataObjectBaseE[_ZN3itk11HDF5ImageIO14WriteMetaArrayIcEEbRKSsPNS_18MetaDataObjectBaseE]+0x109): undefined reference to vnl_vector<char>::~vnl_vector()' itkHDF5ImageIO.cxx:(.text._ZN3itk11HDF5ImageIO14WriteMetaArrayIcEEbRKSsPNS_18MetaDataObjectBaseE[_ZN3itk11HDF5ImageIO14WriteMetaArrayIcEEbRKSsPNS_18MetaDataObjectBaseE]+0x150): undefined reference tovnl_vector::~vnl_vector()’
/home/ja/dev/ITK/build-release/lib/libITKIOHDF5-4.12.a(itkHDF5ImageIO.cxx.o): In function bool itk::HDF5ImageIO::WriteMetaArray<unsigned char>(std::string const&, itk::MetaDataObjectBase*)': itkHDF5ImageIO.cxx:(.text._ZN3itk11HDF5ImageIO14WriteMetaArrayIhEEbRKSsPNS_18MetaDataObjectBaseE[_ZN3itk11HDF5ImageIO14WriteMetaArrayIhEEbRKSsPNS_18MetaDataObjectBaseE]+0x40): undefined reference tovnl_vector::vnl_vector(vnl_vector const&)‘
itkHDF5ImageIO.cxx:(.text._ZN3itk11HDF5ImageIO14WriteMetaArrayIhEEbRKSsPNS_18MetaDataObjectBaseE[_ZN3itk11HDF5ImageIO14WriteMetaArrayIhEEbRKSsPNS_18MetaDataObjectBaseE]+0x101): undefined reference to vnl_vector<unsigned char>::~vnl_vector()' itkHDF5ImageIO.cxx:(.text._ZN3itk11HDF5ImageIO14WriteMetaArrayIhEEbRKSsPNS_18MetaDataObjectBaseE[_ZN3itk11HDF5ImageIO14WriteMetaArrayIhEEbRKSsPNS_18MetaDataObjectBaseE]+0x148): undefined reference tovnl_vector::~vnl_vector()’
/home/ja/dev/ITK/build-release/lib/libITKIOHDF5-4.12.a(itkHDF5ImageIO.cxx.o): In function bool itk::HDF5ImageIO::WriteMetaArray<short>(std::string const&, itk::MetaDataObjectBase*)': itkHDF5ImageIO.cxx:(.text._ZN3itk11HDF5ImageIO14WriteMetaArrayIsEEbRKSsPNS_18MetaDataObjectBaseE[_ZN3itk11HDF5ImageIO14WriteMetaArrayIsEEbRKSsPNS_18MetaDataObjectBaseE]+0x42): undefined reference tovnl_vector::vnl_vector(vnl_vector const&)‘
itkHDF5ImageIO.cxx:(.text._ZN3itk11HDF5ImageIO14WriteMetaArrayIsEEbRKSsPNS_18MetaDataObjectBaseE[_ZN3itk11HDF5ImageIO14WriteMetaArrayIsEEbRKSsPNS_18MetaDataObjectBaseE]+0x1a5): undefined reference to vnl_vector<short>::~vnl_vector()' itkHDF5ImageIO.cxx:(.text._ZN3itk11HDF5ImageIO14WriteMetaArrayIsEEbRKSsPNS_18MetaDataObjectBaseE[_ZN3itk11HDF5ImageIO14WriteMetaArrayIsEEbRKSsPNS_18MetaDataObjectBaseE]+0x20a): undefined reference tovnl_vector::~vnl_vector()’
/home/ja/dev/ITK/build-release/lib/libITKIOHDF5-4.12.a(itkHDF5ImageIO.cxx.o): In function bool itk::HDF5ImageIO::WriteMetaArray<unsigned short>(std::string const&, itk::MetaDataObjectBase*)': itkHDF5ImageIO.cxx:(.text._ZN3itk11HDF5ImageIO14WriteMetaArrayItEEbRKSsPNS_18MetaDataObjectBaseE[_ZN3itk11HDF5ImageIO14WriteMetaArrayItEEbRKSsPNS_18MetaDataObjectBaseE]+0x42): undefined reference tovnl_vector::vnl_vector(vnl_vector const&)‘
itkHDF5ImageIO.cxx:(.text._ZN3itk11HDF5ImageIO14WriteMetaArrayItEEbRKSsPNS_18MetaDataObjectBaseE[_ZN3itk11HDF5ImageIO14WriteMetaArrayItEEbRKSsPNS_18MetaDataObjectBaseE]+0x1a5): undefined reference to vnl_vector<unsigned short>::~vnl_vector()' itkHDF5ImageIO.cxx:(.text._ZN3itk11HDF5ImageIO14WriteMetaArrayItEEbRKSsPNS_18MetaDataObjectBaseE[_ZN3itk11HDF5ImageIO14WriteMetaArrayItEEbRKSsPNS_18MetaDataObjectBaseE]+0x20a): undefined reference tovnl_vector::~vnl_vector()’
/home/ja/dev/ITK/build-release/lib/libITKIOHDF5-4.12.a(itkHDF5ImageIO.cxx.o): In function bool itk::HDF5ImageIO::WriteMetaArray<int>(std::string const&, itk::MetaDataObjectBase*)': itkHDF5ImageIO.cxx:(.text._ZN3itk11HDF5ImageIO14WriteMetaArrayIiEEbRKSsPNS_18MetaDataObjectBaseE[_ZN3itk11HDF5ImageIO14WriteMetaArrayIiEEbRKSsPNS_18MetaDataObjectBaseE]+0x49): undefined reference tovnl_vector::vnl_vector(vnl_vector const&)‘
itkHDF5ImageIO.cxx:(.text._ZN3itk11HDF5ImageIO14WriteMetaArrayIiEEbRKSsPNS_18MetaDataObjectBaseE[_ZN3itk11HDF5ImageIO14WriteMetaArrayIiEEbRKSsPNS_18MetaDataObjectBaseE]+0x1b3): undefined reference to vnl_vector<int>::~vnl_vector()' itkHDF5ImageIO.cxx:(.text._ZN3itk11HDF5ImageIO14WriteMetaArrayIiEEbRKSsPNS_18MetaDataObjectBaseE[_ZN3itk11HDF5ImageIO14WriteMetaArrayIiEEbRKSsPNS_18MetaDataObjectBaseE]+0x21a): undefined reference tovnl_vector::~vnl_vector()’
/home/ja/dev/ITK/build-release/lib/libITKIOHDF5-4.12.a(itkHDF5ImageIO.cxx.o): In function bool itk::HDF5ImageIO::WriteMetaArray<unsigned int>(std::string const&, itk::MetaDataObjectBase*)': itkHDF5ImageIO.cxx:(.text._ZN3itk11HDF5ImageIO14WriteMetaArrayIjEEbRKSsPNS_18MetaDataObjectBaseE[_ZN3itk11HDF5ImageIO14WriteMetaArrayIjEEbRKSsPNS_18MetaDataObjectBaseE]+0x42): undefined reference tovnl_vector::vnl_vector(vnl_vector const&)‘
itkHDF5ImageIO.cxx:(.text._ZN3itk11HDF5ImageIO14WriteMetaArrayIjEEbRKSsPNS_18MetaDataObjectBaseE[_ZN3itk11HDF5ImageIO14WriteMetaArrayIjEEbRKSsPNS_18MetaDataObjectBaseE]+0x1b3): undefined reference to vnl_vector<unsigned int>::~vnl_vector()' itkHDF5ImageIO.cxx:(.text._ZN3itk11HDF5ImageIO14WriteMetaArrayIjEEbRKSsPNS_18MetaDataObjectBaseE[_ZN3itk11HDF5ImageIO14WriteMetaArrayIjEEbRKSsPNS_18MetaDataObjectBaseE]+0x21a): undefined reference tovnl_vector::~vnl_vector()’
/home/ja/dev/ITK/build-release/lib/libITKIOHDF5-4.12.a(itkHDF5ImageIO.cxx.o): In function bool itk::HDF5ImageIO::WriteMetaArray<float>(std::string const&, itk::MetaDataObjectBase*)': itkHDF5ImageIO.cxx:(.text._ZN3itk11HDF5ImageIO14WriteMetaArrayIfEEbRKSsPNS_18MetaDataObjectBaseE[_ZN3itk11HDF5ImageIO14WriteMetaArrayIfEEbRKSsPNS_18MetaDataObjectBaseE]+0x49): undefined reference tovnl_vector::vnl_vector(vnl_vector const&)‘
itkHDF5ImageIO.cxx:(.text._ZN3itk11HDF5ImageIO14WriteMetaArrayIfEEbRKSsPNS_18MetaDataObjectBaseE[_ZN3itk11HDF5ImageIO14WriteMetaArrayIfEEbRKSsPNS_18MetaDataObjectBaseE]+0x1b7): undefined reference to vnl_vector<float>::~vnl_vector()' itkHDF5ImageIO.cxx:(.text._ZN3itk11HDF5ImageIO14WriteMetaArrayIfEEbRKSsPNS_18MetaDataObjectBaseE[_ZN3itk11HDF5ImageIO14WriteMetaArrayIfEEbRKSsPNS_18MetaDataObjectBaseE]+0x21a): undefined reference tovnl_vector::~vnl_vector()’
/home/ja/dev/ITK/build-release/lib/libITKIOHDF5-4.12.a(itkHDF5ImageIO.cxx.o): In function void itk::HDF5ImageIO::StoreMetaData<unsigned long>(itk::MetaDataDictionary*, std::string const&, std::string const&, unsigned long)': itkHDF5ImageIO.cxx:(.text._ZN3itk11HDF5ImageIO13StoreMetaDataImEEvPNS_18MetaDataDictionaryERKSsS5_m[_ZN3itk11HDF5ImageIO13StoreMetaDataImEEvPNS_18MetaDataDictionaryERKSsS5_m]+0x40): undefined reference tovnl_vector::vnl_vector(unsigned long)'
itkHDF5ImageIO.cxx:(.text._ZN3itk11HDF5ImageIO13StoreMetaDataImEEvPNS_18MetaDataDictionaryERKSsS5_m[_ZN3itk11HDF5ImageIO13StoreMetaDataImEEvPNS_18MetaDataDictionaryERKSsS5_m]+0xe7): undefined reference to vnl_vector<unsigned long>::set_size(unsigned long)' itkHDF5ImageIO.cxx:(.text._ZN3itk11HDF5ImageIO13StoreMetaDataImEEvPNS_18MetaDataDictionaryERKSsS5_m[_ZN3itk11HDF5ImageIO13StoreMetaDataImEEvPNS_18MetaDataDictionaryERKSsS5_m]+0xf7): undefined reference tovnl_vector::operator=(vnl_vector const&)‘
itkHDF5ImageIO.cxx:(.text._ZN3itk11HDF5ImageIO13StoreMetaDataImEEvPNS_18MetaDataDictionaryERKSsS5_m[_ZN3itk11HDF5ImageIO13StoreMetaDataImEEvPNS_18MetaDataDictionaryERKSsS5_m]+0x144): undefined reference to vnl_vector<unsigned long>::~vnl_vector()' itkHDF5ImageIO.cxx:(.text._ZN3itk11HDF5ImageIO13StoreMetaDataImEEvPNS_18MetaDataDictionaryERKSsS5_m[_ZN3itk11HDF5ImageIO13StoreMetaDataImEEvPNS_18MetaDataDictionaryERKSsS5_m]+0x233): undefined reference tovnl_vector::~vnl_vector()’
/home/ja/dev/ITK/build-release/lib/libITKIOHDF5-4.12.a(itkHDF5ImageIO.cxx.o): In function void itk::HDF5ImageIO::StoreMetaData<int>(itk::MetaDataDictionary*, std::string const&, std::string const&, unsigned long)': itkHDF5ImageIO.cxx:(.text._ZN3itk11HDF5ImageIO13StoreMetaDataIiEEvPNS_18MetaDataDictionaryERKSsS5_m[_ZN3itk11HDF5ImageIO13StoreMetaDataIiEEvPNS_18MetaDataDictionaryERKSsS5_m]+0x39): undefined reference tovnl_vector::vnl_vector(unsigned long)‘
itkHDF5ImageIO.cxx:(.text._ZN3itk11HDF5ImageIO13StoreMetaDataIiEEvPNS_18MetaDataDictionaryERKSsS5_m[_ZN3itk11HDF5ImageIO13StoreMetaDataIiEEvPNS_18MetaDataDictionaryERKSsS5_m]+0xf4): undefined reference to vnl_vector<int>::~vnl_vector()' itkHDF5ImageIO.cxx:(.text._ZN3itk11HDF5ImageIO13StoreMetaDataIiEEvPNS_18MetaDataDictionaryERKSsS5_m[_ZN3itk11HDF5ImageIO13StoreMetaDataIiEEvPNS_18MetaDataDictionaryERKSsS5_m]+0x1ca): undefined reference tovnl_vector::~vnl_vector()’
/home/ja/dev/ITK/build-release/lib/libITKIOHDF5-4.12.a(itkHDF5ImageIO.cxx.o): In function void itk::HDF5ImageIO::StoreMetaData<char>(itk::MetaDataDictionary*, std::string const&, std::string const&, unsigned long)': itkHDF5ImageIO.cxx:(.text._ZN3itk11HDF5ImageIO13StoreMetaDataIcEEvPNS_18MetaDataDictionaryERKSsS5_m[_ZN3itk11HDF5ImageIO13StoreMetaDataIcEEvPNS_18MetaDataDictionaryERKSsS5_m]+0x35): undefined reference tovnl_vector::vnl_vector(unsigned long)‘
itkHDF5ImageIO.cxx:(.text._ZN3itk11HDF5ImageIO13StoreMetaDataIcEEvPNS_18MetaDataDictionaryERKSsS5_m[_ZN3itk11HDF5ImageIO13StoreMetaDataIcEEvPNS_18MetaDataDictionaryERKSsS5_m]+0xf3): undefined reference to vnl_vector<char>::~vnl_vector()' itkHDF5ImageIO.cxx:(.text._ZN3itk11HDF5ImageIO13StoreMetaDataIcEEvPNS_18MetaDataDictionaryERKSsS5_m[_ZN3itk11HDF5ImageIO13StoreMetaDataIcEEvPNS_18MetaDataDictionaryERKSsS5_m]+0x1cb): undefined reference tovnl_vector::~vnl_vector()’
/home/ja/dev/ITK/build-release/lib/libITKIOHDF5-4.12.a(itkHDF5ImageIO.cxx.o): In function void itk::HDF5ImageIO::StoreMetaData<unsigned char>(itk::MetaDataDictionary*, std::string const&, std::string const&, unsigned long)': itkHDF5ImageIO.cxx:(.text._ZN3itk11HDF5ImageIO13StoreMetaDataIhEEvPNS_18MetaDataDictionaryERKSsS5_m[_ZN3itk11HDF5ImageIO13StoreMetaDataIhEEvPNS_18MetaDataDictionaryERKSsS5_m]+0x3c): undefined reference tovnl_vector::vnl_vector(unsigned long)'
itkHDF5ImageIO.cxx:(.text._ZN3itk11HDF5ImageIO13StoreMetaDataIhEEvPNS_18MetaDataDictionaryERKSsS5_m[_ZN3itk11HDF5ImageIO13StoreMetaDataIhEEvPNS_18MetaDataDictionaryERKSsS5_m]+0xe4): undefined reference to vnl_vector<unsigned char>::set_size(unsigned long)' itkHDF5ImageIO.cxx:(.text._ZN3itk11HDF5ImageIO13StoreMetaDataIhEEvPNS_18MetaDataDictionaryERKSsS5_m[_ZN3itk11HDF5ImageIO13StoreMetaDataIhEEvPNS_18MetaDataDictionaryERKSsS5_m]+0xf4): undefined reference tovnl_vector::operator=(vnl_vector const&)‘
itkHDF5ImageIO.cxx:(.text._ZN3itk11HDF5ImageIO13StoreMetaDataIhEEvPNS_18MetaDataDictionaryERKSsS5_m[_ZN3itk11HDF5ImageIO13StoreMetaDataIhEEvPNS_18MetaDataDictionaryERKSsS5_m]+0x141): undefined reference to vnl_vector<unsigned char>::~vnl_vector()' itkHDF5ImageIO.cxx:(.text._ZN3itk11HDF5ImageIO13StoreMetaDataIhEEvPNS_18MetaDataDictionaryERKSsS5_m[_ZN3itk11HDF5ImageIO13StoreMetaDataIhEEvPNS_18MetaDataDictionaryERKSsS5_m]+0x232): undefined reference tovnl_vector::~vnl_vector()’
/home/ja/dev/ITK/build-release/lib/libITKIOHDF5-4.12.a(itkHDF5ImageIO.cxx.o): In function void itk::HDF5ImageIO::StoreMetaData<short>(itk::MetaDataDictionary*, std::string const&, std::string const&, unsigned long)': itkHDF5ImageIO.cxx:(.text._ZN3itk11HDF5ImageIO13StoreMetaDataIsEEvPNS_18MetaDataDictionaryERKSsS5_m[_ZN3itk11HDF5ImageIO13StoreMetaDataIsEEvPNS_18MetaDataDictionaryERKSsS5_m]+0x3f): undefined reference tovnl_vector::vnl_vector(unsigned long)'
itkHDF5ImageIO.cxx:(.text._ZN3itk11HDF5ImageIO13StoreMetaDataIsEEvPNS_18MetaDataDictionaryERKSsS5_m[_ZN3itk11HDF5ImageIO13StoreMetaDataIsEEvPNS_18MetaDataDictionaryERKSsS5_m]+0xe2): undefined reference to vnl_vector<short>::set_size(unsigned long)' itkHDF5ImageIO.cxx:(.text._ZN3itk11HDF5ImageIO13StoreMetaDataIsEEvPNS_18MetaDataDictionaryERKSsS5_m[_ZN3itk11HDF5ImageIO13StoreMetaDataIsEEvPNS_18MetaDataDictionaryERKSsS5_m]+0xf2): undefined reference tovnl_vector::operator=(vnl_vector const&)‘
itkHDF5ImageIO.cxx:(.text._ZN3itk11HDF5ImageIO13StoreMetaDataIsEEvPNS_18MetaDataDictionaryERKSsS5_m[_ZN3itk11HDF5ImageIO13StoreMetaDataIsEEvPNS_18MetaDataDictionaryERKSsS5_m]+0x13f): undefined reference to vnl_vector<short>::~vnl_vector()' itkHDF5ImageIO.cxx:(.text._ZN3itk11HDF5ImageIO13StoreMetaDataIsEEvPNS_18MetaDataDictionaryERKSsS5_m[_ZN3itk11HDF5ImageIO13StoreMetaDataIsEEvPNS_18MetaDataDictionaryERKSsS5_m]+0x22b): undefined reference tovnl_vector::~vnl_vector()’
/home/ja/dev/ITK/build-release/lib/libITKIOHDF5-4.12.a(itkHDF5ImageIO.cxx.o): In function void itk::HDF5ImageIO::StoreMetaData<unsigned short>(itk::MetaDataDictionary*, std::string const&, std::string const&, unsigned long)': itkHDF5ImageIO.cxx:(.text._ZN3itk11HDF5ImageIO13StoreMetaDataItEEvPNS_18MetaDataDictionaryERKSsS5_m[_ZN3itk11HDF5ImageIO13StoreMetaDataItEEvPNS_18MetaDataDictionaryERKSsS5_m]+0x3f): undefined reference tovnl_vector::vnl_vector(unsigned long)'
itkHDF5ImageIO.cxx:(.text._ZN3itk11HDF5ImageIO13StoreMetaDataItEEvPNS_18MetaDataDictionaryERKSsS5_m[_ZN3itk11HDF5ImageIO13StoreMetaDataItEEvPNS_18MetaDataDictionaryERKSsS5_m]+0xe2): undefined reference to vnl_vector<unsigned short>::set_size(unsigned long)' itkHDF5ImageIO.cxx:(.text._ZN3itk11HDF5ImageIO13StoreMetaDataItEEvPNS_18MetaDataDictionaryERKSsS5_m[_ZN3itk11HDF5ImageIO13StoreMetaDataItEEvPNS_18MetaDataDictionaryERKSsS5_m]+0xf2): undefined reference tovnl_vector::operator=(vnl_vector const&)‘
itkHDF5ImageIO.cxx:(.text._ZN3itk11HDF5ImageIO13StoreMetaDataItEEvPNS_18MetaDataDictionaryERKSsS5_m[_ZN3itk11HDF5ImageIO13StoreMetaDataItEEvPNS_18MetaDataDictionaryERKSsS5_m]+0x13f): undefined reference to vnl_vector<unsigned short>::~vnl_vector()' itkHDF5ImageIO.cxx:(.text._ZN3itk11HDF5ImageIO13StoreMetaDataItEEvPNS_18MetaDataDictionaryERKSsS5_m[_ZN3itk11HDF5ImageIO13StoreMetaDataItEEvPNS_18MetaDataDictionaryERKSsS5_m]+0x22b): undefined reference tovnl_vector::~vnl_vector()’
/home/ja/dev/ITK/build-release/lib/libITKIOHDF5-4.12.a(itkHDF5ImageIO.cxx.o): In function void itk::HDF5ImageIO::StoreMetaData<unsigned int>(itk::MetaDataDictionary*, std::string const&, std::string const&, unsigned long)': itkHDF5ImageIO.cxx:(.text._ZN3itk11HDF5ImageIO13StoreMetaDataIjEEvPNS_18MetaDataDictionaryERKSsS5_m[_ZN3itk11HDF5ImageIO13StoreMetaDataIjEEvPNS_18MetaDataDictionaryERKSsS5_m]+0x40): undefined reference tovnl_vector::vnl_vector(unsigned long)'
itkHDF5ImageIO.cxx:(.text._ZN3itk11HDF5ImageIO13StoreMetaDataIjEEvPNS_18MetaDataDictionaryERKSsS5_m[_ZN3itk11HDF5ImageIO13StoreMetaDataIjEEvPNS_18MetaDataDictionaryERKSsS5_m]+0xe8): undefined reference to vnl_vector<unsigned int>::set_size(unsigned long)' itkHDF5ImageIO.cxx:(.text._ZN3itk11HDF5ImageIO13StoreMetaDataIjEEvPNS_18MetaDataDictionaryERKSsS5_m[_ZN3itk11HDF5ImageIO13StoreMetaDataIjEEvPNS_18MetaDataDictionaryERKSsS5_m]+0xf8): undefined reference tovnl_vector::operator=(vnl_vector const&)‘
itkHDF5ImageIO.cxx:(.text._ZN3itk11HDF5ImageIO13StoreMetaDataIjEEvPNS_18MetaDataDictionaryERKSsS5_m[_ZN3itk11HDF5ImageIO13StoreMetaDataIjEEvPNS_18MetaDataDictionaryERKSsS5_m]+0x145): undefined reference to vnl_vector<unsigned int>::~vnl_vector()' itkHDF5ImageIO.cxx:(.text._ZN3itk11HDF5ImageIO13StoreMetaDataIjEEvPNS_18MetaDataDictionaryERKSsS5_m[_ZN3itk11HDF5ImageIO13StoreMetaDataIjEEvPNS_18MetaDataDictionaryERKSsS5_m]+0x232): undefined reference tovnl_vector::~vnl_vector()’

Hi Ja,

What is the version of Fedora?

Thanks,
Matt

Your CMakeLists.txt looks normal, declaring a lower minimum version should not be a problem.

Hi Matt,

Thank you very much for your response. The operating system is Fedora release 18 (Spherical Cow).

Best regards,

Ja

Thank you very much, Dženan.

I had this problem compiling ITK 4.12 with CMake 2.8.12.2 on CentOS 6. It went away when I built ITK with CMake 3.6.1.

2 Likes

Thank you very much, Philip. I will update CMake and try compiling the code again.

I successfully compiled and ran the read-image-file code after I used CMake 3 to configure both ITK and the code. Thank you very much, Philip and everyone.

2 Likes