# FFTWComplexToComplexFFTImageFilter linker error: undefined reference to GenerateInputRequestedRegion()

**URL:** https://discourse.itk.org/t/fftwcomplextocomplexfftimagefilter-linker-error-undefined-reference-to-generateinputrequestedregion/567
**Category:** Engineering
**Created:** [January 3, 2018, 3:36am UTC](https://discourse.itk.org/t/fftwcomplextocomplexfftimagefilter-linker-error-undefined-reference-to-generateinputrequestedregion/567 "2018-01-03T03:36:36Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Pierrick](https://discourse.itk.org/letter_avatar_proxy/v4/letter/p/58f4c7/32.png) [@Pierrick](https://discourse.itk.org/u/Pierrick)
#### Post date: [January 3, 2018, 3:36am UTC](https://discourse.itk.org/t/fftwcomplextocomplexfftimagefilter-linker-error-undefined-reference-to-generateinputrequestedregion/567/1 "2018-01-03T03:36:37Z")

</div>

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

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [January 3, 2018, 6:11pm UTC](https://discourse.itk.org/t/fftwcomplextocomplexfftimagefilter-linker-error-undefined-reference-to-generateinputrequestedregion/567/2 "2018-01-03T18:11:18Z")

</div>

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

---

<div class="post-metadata">

### Author: ![fbudin](https://discourse.itk.org/user_avatar/discourse.itk.org/fbudin/32/14_2.png) [@fbudin](https://discourse.itk.org/u/fbudin)
#### Post date: [January 3, 2018, 7:54pm UTC](https://discourse.itk.org/t/fftwcomplextocomplexfftimagefilter-linker-error-undefined-reference-to-generateinputrequestedregion/567/3 "2018-01-03T19:54:23Z")

</div>

Hello @Pierrick,

I created a patch for ITK here:  
[http://review.source.kitware.com/#/c/22960/](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!

---

<div class="post-metadata">

### Author: ![Pierrick](https://discourse.itk.org/letter_avatar_proxy/v4/letter/p/58f4c7/32.png) [@Pierrick](https://discourse.itk.org/u/Pierrick)
#### Post date: [January 4, 2018, 1:27am UTC](https://discourse.itk.org/t/fftwcomplextocomplexfftimagefilter-linker-error-undefined-reference-to-generateinputrequestedregion/567/4 "2018-01-04T01:27:33Z")

</div>

Hi @fbudin,

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

-Pierrick

---

<div class="post-metadata">

### Author: ![fbudin](https://discourse.itk.org/user_avatar/discourse.itk.org/fbudin/32/14_2.png) [@fbudin](https://discourse.itk.org/u/fbudin)
#### Post date: [January 4, 2018, 2:07pm UTC](https://discourse.itk.org/t/fftwcomplextocomplexfftimagefilter-linker-error-undefined-reference-to-generateinputrequestedregion/567/5 "2018-01-04T14:07:01Z")

</div>

Thanks for testing!
