FFTWComplexToComplexFFTImageFilter linker error: undefined reference to GenerateInputRequestedRegion()

Hi All,

I’ve been trying to use the FFTWComplexToComplexFFTImageFilter filter, but get linker errors:

CMakeFiles/TestFFTW.dir/TestFFTW.cxx.o:(.rodata._ZTVN3itk30ComplexToComplexFFTImageFilterINS_5ImageISt7complexIfELj3EEEEE[_ZTVN3itk30ComplexToComplexFFTImageFilterINS_5ImageISt7complexIfELj3EEEEE]+0x258): undefined reference to `itk::ComplexToComplexFFTImageFilter<itk::Image<std::complex<float>, 3u> >::GenerateInputRequestedRegion()'
CMakeFiles/TestFFTW.dir/TestFFTW.cxx.o:(.rodata._ZTVN3itk34FFTWComplexToComplexFFTImageFilterINS_5ImageISt7complexIfELj3EEEEE[_ZTVN3itk34FFTWComplexToComplexFFTImageFilterINS_5ImageISt7complexIfELj3EEEEE]+0x258): undefined reference to `itk::ComplexToComplexFFTImageFilter<itk::Image<std::complex<float>, 3u> >::GenerateInputRequestedRegion()'

I’ve tested this with ITK 4.10 and the latest release 4.13 (compiled with ITK_USE_FFTWF turned on, and get the same result if I turn ITK_USE_SYSTEM_FFTW ON or OFF).

This is the test code I use:

#include "itkImage.h"
#include <iostream>
#include "itkFFTWComplexToComplexFFTImageFilter.h"

int main()
{
 
  typedef std::complex<float>  CplxPixelType;
  typedef itk::Image<CplxPixelType, 3>  CplxImageType;
  typedef itk::FFTWComplexToComplexFFTImageFilter<CplxImageType> FFTWComplexToComplexFilterType;
  typename FFTWComplexToComplexFilterType::Pointer m_CplxToCplxFFT = FFTWComplexToComplexFilterType::New();

  return 0;
}

with CMakeLists:

cmake_minimum_required(VERSION 2.8)

project(TestFFTW)

# Find ITK.
find_package(ITK REQUIRED)
include(${ITK_USE_FILE})

add_executable(TestFFTW TestFFTW.cxx )

target_link_libraries(TestFFTW ${ITK_LIBRARIES})

Any suggestions on what could be causing this issue?
Thanks
-Pierrick

I can reproduce this problem on Linux with a recent git master version. Trying to figure out what is causing it.

Hello @Pierrick,

I created a patch for ITK here:
http://review.source.kitware.com/#/c/22960/

Please test it if you can to verify that this solves your problem.
As a work around, you can also add #include "itkComplexToComplexFFTImageFilter.h" to your code above #include "itkFFTWComplexToComplexFFTImageFilter.h", and that should get rid of your problem too.

Hope this helps!

2 Likes

Hi @fbudin,

I’ve tested the patch and the workaround, and both solve the linking errors.
Thank you for the very fast response.

-Pierrick

1 Like

Thanks for testing!