Results 1 to 8 of 8

Thread: fftw unable to compile

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Posts
    22
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question fftw unable to compile

    Hi,

    I've downloaded and installed fftw 3.0.1 ( on Mandrake 10, AMD athlon). Now, i am unable to compile any programs using fftw...
    I am including the header file <fftw3.h> ion the program.
    On running gcc, the compiler throws back this :
    Qt Code:
    1. /home/utsav/tmp/ccsMtd04.o(.text+0x1a): In function `main':
    2. : undefined reference to `fftw_malloc'
    3. /home/utsav/tmp/ccsMtd04.o(.text+0x2d): In function `main':
    4. : undefined reference to `fftw_malloc'
    5. /home/utsav/tmp/ccsMtd04.o(.text+0x79): In function `main':
    6. : undefined reference to `fftw_plan_dft_1d'
    7. /home/utsav/tmp/ccsMtd04.o(.text+0x8a): In function `main':
    8. : undefined reference to `fftw_execute'
    9. /home/utsav/tmp/ccsMtd04.o(.text+0xe2): In function `main':
    10. : undefined reference to `fftw_destroy_plan'
    11. /home/utsav/tmp/ccsMtd04.o(.text+0xf0): In function `main':
    12. : undefined reference to `fftw_free'
    13. /home/utsav/tmp/ccsMtd04.o(.text+0xfe): In function `main':
    14. : undefined reference to `fftw_free'
    15. collect2: ld returned 1 exit status
    To copy to clipboard, switch view to plain text mode 

    What am i doing wrong???

    Thanks
    superutsav
    He who laughs last thinks slowest.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: fftw unable to compile

    Did you add "-lfftw" to tell gcc that you want to link with fftw?

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: fftw unable to compile

    You're not linking with the library. Add "-lfftw" (or something like that) to your linker flags.

  4. #4
    Join Date
    Jan 2006
    Posts
    22
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: fftw unable to compile

    Thanks for the -lfftw thing...
    However, i now have a new error:

    Qt Code:
    1. /usr/bin/ld: cannot find -lfftw
    2. collect2: ld returned 1 exit status
    To copy to clipboard, switch view to plain text mode 

    superutsav
    He who laughs last thinks slowest.

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: fftw unable to compile

    Quote Originally Posted by superutsav
    Thanks for the -lfftw thing...
    However, i now have a new error:

    Qt Code:
    1. /usr/bin/ld: cannot find -lfftw
    2. collect2: ld returned 1 exit status
    To copy to clipboard, switch view to plain text mode 
    locate libfftw
    and add -L with a directory where it resides
    And check if it is libfftw or libfftw3, maybe you just need to change "-lfftw" to "-lfftw3"

  6. #6
    Join Date
    Jan 2006
    Posts
    22
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: fftw unable to compile

    Hey... Thanks again... this time, however, there's yet another error, and i think this is an intrinsic fftw error:

    Qt Code:
    1. /usr/local/lib/libfftw3.a(trig1.o)(.text+0xb9): In function `fftw_sincos':
    2. : undefined reference to `cos'
    3. /usr/local/lib/libfftw3.a(trig1.o)(.text+0xe5): In function `fftw_sincos':
    4. : undefined reference to `sin'
    5. collect2: ld returned 1 exit status
    To copy to clipboard, switch view to plain text mode 


    What can i do about this?
    superutsav
    He who laughs last thinks slowest.

  7. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: fftw unable to compile

    Quote Originally Posted by superutsav
    : undefined reference to `cos'
    [...]
    What can i do about this?
    You are not linking your program with maths library ("-lm").

  8. #8
    Join Date
    Jan 2006
    Posts
    22
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: fftw unable to compile

    Thanks guys...
    That was an awesome quick reply... the fastest i've ever got on a forum
    problem solved ... thanks
    superutsav
    He who laughs last thinks slowest.

Similar Threads

  1. How to Compile VTKDesigner2 with Qt?
    By alfredoaal in forum Newbie
    Replies: 0
    Last Post: 5th September 2008, 06:34
  2. Replies: 1
    Last Post: 7th August 2008, 14:46
  3. qtgui4.dll error in visual c++ 2005
    By Comptrol in forum Installation and Deployment
    Replies: 33
    Last Post: 19th June 2008, 08:18
  4. Access to PostgreSQL DB on a linux server
    By rmagro in forum Qt Programming
    Replies: 28
    Last Post: 13th March 2008, 10:02

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.