开发者

'undefined reference' problem of using FFTW

开发者 https://www.devze.com 2023-03-26 21:21 出处:网络
I am a beginner of the great FFT library \"FFTW\", and nowdays I\'ve met a strange problem which confused me:

I am a beginner of the great FFT library "FFTW", and nowdays I've met a strange problem which confused me:

I've downloaded the pre-compiled binary packet for Windows, and I've written some test codes which include the function like 'fftwf_malloc' etc, but when I tried to compile the codes, I just got 'undefined reference' problems :(

I've searched the header codes and I've found that the header file 开发者_Go百科'fftw3.h' seems doesn't define the 'fftwf_malloc' at all ... Then how can use it ? I am just confused ...

Dose anyone knows something about this ? Thanks :)


I think you need to tell your compiler/linker where to find the appropriate library. On Unix system, link with -lfftw3 -lm. On Windows, the way to do this is probably going to depend on what compiler you're using.


Note: FFTW comes built in various precisions, so you may need to do -lfftw3 -lfftw3f. If you skip one of those the undefined-symbol errors don't change much so it's easy to overlook.

0

精彩评论

暂无评论...
验证码 换一张
取 消