[ITK] [ITK-users] undefined reference to `vnl_vector<T>::~vnl_vector()'

Dženan Zukić dzenanz at gmail.com
Fri Oct 13 09:59:49 EDT 2017


Hi Ja,

which CMakeLists.txt did you use for this simple example? Did you configure
you simple example with CMake or did you just invoke compiler directly? If
directly invoking the compiler, you need to pass a long list of ITK
libraries which need to be linked.

An example CMakeLists file is attached.

We are trying to migrate to a discussion forum, discourse.itk.org Can you
post future questions there?

Regards,
Dženan

On Fri, Oct 13, 2017 at 3:19 AM, Sureerat Reaungamornrat <
sureerat.r at gmail.com> wrote:

> Dear All,
>
> 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<T>::~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<ImageType>  ImageFileReaderType;
>   ImageFileReaderType::Pointer reader = ImageFileReaderType::New();
>   reader->SetFileName("some_image_filename");
>   reader->Update();
>
>   ImageType::Pointer image = reader->GetOutput();
>
>   return EXIT_SUCCESS;
> }
>
> Thank you very much for you time and help,
>
> Best regards,
>
> Ja
>
> The ITK community is transitioning from this mailing list to
> discourse.itk.org. Please join us there!
> ________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/insight-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20171013/e8dce152/attachment.html>
-------------- next part --------------
cmake_minimum_required(VERSION 3.6)

PROJECT(tester CXX)

FIND_PACKAGE(ITK REQUIRED)
INCLUDE(${ITK_USE_FILE})
  
ADD_EXECUTABLE(tester tester.cpp)

TARGET_LINK_LIBRARIES(tester ${ITK_LIBRARIES})
-------------- next part --------------
The ITK community is transitioning from this mailing list to discourse.itk.org. Please join us there!
________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/insight-users


More information about the Community mailing list