title: Problems using FFTW library in Linux and Eclipse IDE
body: <p>So I'm working with some older code I wrote some time ago. I was originally going to port it to Windows, had some success, but quickly ran into other problems and decided to move back to a *nix environment. The original code compiled and ran just fine in the first try.</p>
  
  <p>I'm running Ubuntu 11.10 and have chosen Eclipse as my IDE. When compiling and running the original code, everything is fine. Now I've installed the FFTW library ([fftw.org][1]) and can't seem to build anything that uses the library.</p>
  
  <p>I installed the library using aptitude in the terminal:</p>
  
  <pre><code>sudo apt-get install libfftw3-dev libfftw3-doc
  </code></pre>
  
  <p>The library definitely exists:</p>
  
  <pre><code>~$ g++ -lfftw3
  /usr/lib/gcc/x86_64-linux-gnu/4.6.1/../../../x86_64-linux-gnu/crt1.o: In function `_start':
  (.text+0x20): undefined reference to `main'
  collect2: ld returned 1 exit status
  </code></pre>
  
  <p>And I've added "fftw3" to my project's properties->C++ Linker->Libraries list in Eclipse.</p>
  
  <p>The header file  is found just fine.</p>
  
  <p>When I go to compile, every single data type that is defined in the library fails to be defined, so essentially the compiler has no idea what to do.</p>
  
  <p>I'm a bit stumped...</p>
  
  <p>Here's one of the errors (they're all identical):
  Line:</p>
  
  <pre><code>fftw_real a[M][N];
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>error: ‘fftw_real’ was not declared in this scope
  </code></pre>
  
  <p>I'm not sure what else to try. Your help and expertise is greatly appreciated. Thanks in advance.</p>
  
  <p><strong>SOLVED! Here's the solution</strong></p>
  
  <p>For anyone else working with <em>OLD CODE</em> and low on sleep, searching on Google and StackOverflow for a solution to a similar problem, learn from my stupid mistake instead of making your own.</p>
  
  <p>The key phrase here is <em>old code</em>. My code was written for FFTW 2, but I'm using version 3 of the library, which has a radically different interface. I had to update all my code that uses the library, then everything worked as normal.</p>
  
  <p>Doh! How dumb. I hope someone out in Google land finds this useful some day.</p>
  
  <p>Thank you, Dietmar Kühl, for helping me realize what was wrong. I appreciate you taking the time to install the library and poke around; that was very nice of you.</p>