title: ERROR LNK2019 ( Unresolved external symbol) IN VS2008 WITH ITK AND FFTW
body: <p>I am performing a project with ITK for processing medical images. After a lot of work there is no further compilation errors, but in the linking process I am having the following info :</p>
  <blockquote>
  <p>1&gt;------Generation started: proyect: prueba_r01, configuration: Debug Win32 ------
  1&gt;Linking…
  1&gt;Creating library C:\Documents and Settings\GTTS\Mis documentos\Visual Studio 2008\Projects\prueba_r01\Debug\prueba_r01.lib and object C:\Documents and Settings\GTTS\Mis documentos\Visual Studio 2008\Projects\prueba_r01\Debug\prueba_r01.exp</p>
  <p>1&gt;prueba_r01.obj : error LNK2019: extern symbol &quot;public: double (* __thiscall prueba_r01::multiply_matrix_2D(double (<em>)[2],double (</em>)[2],int,int))[2]&quot; (?multiply_matrix_2D@prueba_r01@@QAEPAY01NPAY01N0HH@Z) unresolved which is referenced in the function &quot;private: void __thiscall prueba_r01::filtro(void)&quot; (?filtro@prueba_r01@@AAEXXZ)</p>
  <p>1&gt;C:\Documents and Settings\GTTS\Mis documentos\Visual Studio 2008\Projects\prueba_r01\Debug\prueba_r01.exe : fatal error LNK1120: 1 externos sin resolver</p>
  <p>1&gt;prueba_r01 - 2 errors, 0 warnings
  ========== Generar: 0 corrects, 1 incorrects, 0 actualized, 0 omited ==========</p>
  </blockquote>
  <p>The method multiply_matrix_2D produces the error when is called inside the private slot “filtro()” (translated as filter)
  The header of the file is :</p>
  <pre><code>#include &lt;QtGui/QMainWindow&gt;
  #include &quot;ui_prueba_r01.h&quot;
  #include &quot;vicdef.h&quot;
  #include &quot;itkImage.h&quot;
  #include &quot;math.h&quot;
  #include &lt;complex&gt;
  #include &quot;fftw3.h&quot;
  using namespace std;
  
  #define PI 3.14159265
  
  class prueba_r01 : public QMainWindow
  {
  Q_OBJECT
  
  public:
  typedef double PixelType;
  typedef itk::Image &lt; PixelType, 2&gt; ImageType;
      ImageType::Pointer imagen;
  
  double** H;
  
  prueba_r01(QWidget *parent = 0, Qt::WFlags flags = 0);
  ~prueba_r01();
  
  void matrix2D_H(int ancho, int alto, double eta, double sigma);
  fftw_complex* multiply_matrix_2D(fftw_complex* out, fftw_complex* H,int a, int b);
  
  private slots:
  void openRGB();
  void filtro();
  
  
  private:
  Ui::prueba_r01Class ui;
  };
  
  #endif // PRUEBA_R01_H
  </code></pre>
  <p>And the main part where the problem is located is in the .cpp file and is displayed here:</p>
  <pre><code>fftw_complex* res ;
  res = (fftw_complex*) fftw_malloc(sizeof(fftw_complex)*a*b);
  fftw_complex* H_casted= reinterpret_cast&lt;fftw_complex*&gt; (&amp;H);
  res = multiply_matrix_2D(out,H_casted, a, b);
  </code></pre>
  <p>The process of casting a **double pointer to *fftw_complex is done here, because I want to multiply a filter in frequency domain (H(w)) with the result of the fft transform of an image, that’s the reason. Is important to remark that fftw_complex is double[2], the first row for the real part, and the second for the imaginary
  And the problematic method is shown below:</p>
  <pre><code> fftw_complex* multiply_matrix_2D(fftw_complex* out, fftw_complex* H, int a ,int b){
  /* The matrix out[axb] or [n0x(n1/2)+1] is the image after the FFT , and the           out_H[axb] is the filter in the frequency domain,
  both are multiplied POINT TO POINT, it has to be called  twice, one for the imaginary part and another for the normal part
  */
   fftw_complex *res;
   res = (fftw_complex*) fftw_malloc(sizeof(fftw_complex)*a*b);
   for (int i0 = 0; i0&lt;a ; i0++){
  for (int i1 = 0; i1&lt;b ; i1++){
   res[i1+a*i0][0] = out[i1+a*i0][0]*(H[0][0]+H[0][1]); // real part          
   res[i1+a*i0][1] = out[i1+a*i0][1]*(H[0][0]+H[0][1]); // imaginary part
      }
   }
   return res;
   }
  </code></pre>
  <p>Any help will be really nice!! I’m quite lost now…
  Thanks! Gracias!
  Antonio</p>