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

Sureerat Reaungamornrat sureerat.r at gmail.com
Fri Oct 13 11:17:44 EDT 2017


Dear Dženan,

Thank you very much for your response. I have moved this content to the
discussion forum (discourse.itk.org).

I also answered your question in the forum. I used the same CMake file as
you provided, except that in my CMake, I set the CMake version as

cmake_minimum_required(VERSION 2.8)

where yours is
cmake_minimum_required(VERSION 3.6)

Is it because of this setting that triggers error?

//-------------------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})


Thank you very much again for your time and help,

Best regards,

Ja

On Fri, Oct 13, 2017 at 8:59 PM, Dženan Zukić <dzenanz at gmail.com> wrote:

> 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/insight-users/attachments/20171013/5c92a3a9/attachment.html>


More information about the Insight-users mailing list