0
点赞
收藏
分享

微信扫一扫

undefined reference to `__gmp_get_memory_functions'


参考文章: ​​http://blog.sina.com.cn/s/blog_62d82c2f0100hnim.html​​​


今天在安装mpfr-3.1.2.tar.bz2时,出现如下错误:
libtool: link: gcc -std=gnu99 -Wall -Wmissing-prototypes -Wpointer-arith -m32 -O2 -pedantic -fomit-frame-pointer -mtune=core2 -march=core2 -ffloat-store -o tversion tversion.o  -L../src/.libs ./.libs/libfrtests.a -lm ../src/.libs/libmpfr.so -lgmp -Wl,-rpath -Wl,/tmp/11/mpfr-3.1.2/src/.libs -Wl,-rpath -Wl,/usr/local/lib
./.libs/libfrtests.a(tests.o): In function `src_fopen':
tests.c:(.text+0x92f): undefined reference to `__gmp_get_memory_functions'
tests.c:(.text+0x98d): undefined reference to `__gmp_get_memory_functions'
collect2: ld returned 1 exit status
make[2]: *** [tversion] Error 1
make[2]: Leaving directory `/tmp/11/mpfr-3.1.2/tests'
make[1]: *** [check-am] Error 2
make[1]: Leaving directory `/tmp/11/mpfr-3.1.2/tests'
make: *** [check-recursive] Error 1


原因是我在运行configure时没有指定gmp的库目录和gmp的头文件目录
加上参数即可:

./configure --with-gmp-include=/usr/local/include --with-gmp-lib=/usr/local/lib

./configure --with-gmp-include=/usr/local/include --with-gmp-lib=/usr/local/lib --with-gmp-share=/usr/local/share/info/

举报

相关推荐

0 条评论