dubo的个人博客分享 http://blog.sciencenet.cn/u/dubo

博文

undefined reference to `fftw_malloc' 等错误解决办法

已有 20574 次阅读 2012-9-17 09:23 |个人分类:计算机技术|系统分类:科研笔记| Reference, 办法, undefined

BCascade_204.o(.text+0x1c06):/home/kmyadam/sprogworking/BCascade_204.cpp:944: undefined reference to `fftw_malloc'
BCascade_204.o(.text+0x1c31):/home/kmyadam/sprogworking/BCascade_204.cpp:945: undefined reference to `fftw_malloc'
BCascade_204.o(.text+0x1c6b):/home/kmyadam/sprogworking/BCascade_204.cpp:947: undefined reference to `fftw_plan_dft_r2c_2d'
BCascade_204.o(.text+0x1ca5):/home/kmyadam/sprogworking/BCascade_204.cpp:948: undefined reference to `fftw_plan_dft_c2r_2d'
BCascade_204.o(.text+0x1e8d): In function `BCascade::deallocate_memory()':
/home/kmyadam/sprogworking/BCascade_204.cpp:1076: undefined reference to `fftw_destroy_plan'
BCascade_204.o(.text+0x1eba):/home/kmyadam/sprogworking/BCascade_204.cpp:1081: undefined reference to `fftw_destroy_plan'
BCascade_204.o(.text+0x1ee7):/home/kmyadam/sprogworking/BCascade_204.cpp:1086: undefined reference to `fftw_free'
BCascade_204.o(.text+0x1f14):/home/kmyadam/sprogworking/BCascade_204.cpp:1091: undefined reference to `fftw_free'
BCascade_204.o(.text+0x1f41):/home/kmyadam/sprogworking/BCascade_204.cpp:1096: undefined reference to `fftw_free'
BCascade_204.o(.text+0x3347): In function `BCascade::filter_cascade(float*)':
/home/kmyadam/sprogworking/BCascade_204.cpp:1723: undefined reference to `fftw_execute'
BCascade_204.o(.text+0x3420):/home/kmyadam/sprogworking/BCascade_204.cpp:1741: undefined reference to `fftw_execute'
BCascade_204.o(.text+0x39a3): In function `BCascade::decompose_fftw(float*, float*, float*, float*)':
/home/kmyadam/sprogworking/BCascade_204.cpp:1983: undefined reference to `fftw_execute'
BCascade_204.o(.text+0x3abe):/home/kmyadam/sprogworking/BCascade_204.cpp:2011: undefined reference to `fftw_execute'
Stochastic_Cascade_103.o(.text+0x12b8): In function `Stochastic_Cascade::make_noise(float*, _IO_FILE*)':
/home/kmyadam/sprogworking/Stochastic_Cascade_103.cpp:450: undefined reference to `fftw_execute'
Stochastic_Cascade_103.o(.text+0x1475):/home/kmyadam/sprogworking/Stochastic_Cascade_103.cpp:484: more undefined references to `fftw_execute' follow
collect2: ld returned 1 exit status
 
解决办法:
LIBS = -lm -lstdc++ -lfftw3

$(EXECUTABLE): $(OBJECTFILES)
$(CC) -o $(EXECUTABLE) $(OBJECTFILES) $(LIBS)
(格式有点乱,改了半天不知怎么改,注意一下前有美元字符)
 
-lstdc++  :包含 g++的部分库,
 -lm :加上数学库 ,
-lfftw3 :加上fftw的库


https://blog.sciencenet.cn/blog-464042-613517.html

上一篇:谁能告诉我我们为什么要做科研啊?
下一篇:matlab_遗传算法——示例
收藏 IP: 202.113.8.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-11-25 11:58

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部