编译GCC4.1.2问题
在make gcc4.1.2的时候会有下面的错误
fortran/simplify.o: In function `gfc_simplify_spacing':
/root/gcc-4.1.2/host-x86_64-unknown-linux-gnu/gcc/../.././gcc/fortran/simplify.c:3569: undefined reference to `mpfr_set_ui_2exp'
/root/gcc-4.1.2/host-x86_64-unknown-linux-gnu/gcc/../.././gcc/fortran/simplify.c:3549: undefined reference to `mpfr_set_erangeflag'
fortran/simplify.o: In function `gfc_simplify_fraction':
/root/gcc-4.1.2/host-x86_64-unknown-linux-gnu/gcc/../.././gcc/fortran/simplify.c:1147: undefined reference to `mpfr_set_erangeflag'
fortran/simplify.o: In function `gfc_simplify_set_exponent':
/root/gcc-4.1.2/host-x86_64-unknown-linux-gnu/gcc/../.././gcc/fortran/simplify.c:3300: undefined reference to `mpfr_set_erangeflag'
fortran/simplify.o: In function `gfc_simplify_scale':
/root/gcc-4.1.2/host-x86_64-unknown-linux-gnu/gcc/../.././gcc/fortran/simplify.c:3131: undefined reference to `mpfr_set_ui_2exp'
/root/gcc-4.1.2/host-x86_64-unknown-linux-gnu/gcc/../.././gcc/fortran/simplify.c:3099: undefined reference to `mpfr_set_erangeflag'
/root/gcc-4.1.2/host-x86_64-unknown-linux-gnu/gcc/../.././gcc/fortran/simplify.c:3131: undefined reference to `mpfr_set_ui_2exp'
fortran/simplify.o: In function `gfc_simplify_rrspacing':
/root/gcc-4.1.2/host-x86_64-unknown-linux-gnu/gcc/../.././gcc/fortran/simplify.c:3054: undefined reference to `mpfr_set_erangeflag'
fortran/simplify.o: In function `gfc_simplify_exponent':
/root/gcc-4.1.2/host-x86_64-unknown-linux-gnu/gcc/../.././gcc/fortran/simplify.c:1068: undefined reference to `mpfr_set_erangeflag'
fortran/simplify.o: In function `gfc_simplify_nearest':
/root/gcc-4.1.2/host-x86_64-unknown-linux-gnu/gcc/../.././gcc/fortran/simplify.c:2491: undefined reference to `mpfr_nextbelow'
/root/gcc-4.1.2/host-x86_64-unknown-linux-gnu/gcc/../.././gcc/fortran/simplify.c:2491: undefined reference to `mpfr_nextabove'
/root/gcc-4.1.2/host-x86_64-unknown-linux-gnu/gcc/../.././gcc/fortran/simplify.c:2499: undefined reference to `mpfr_nextabove'
/root/gcc-4.1.2/host-x86_64-unknown-linux-gnu/gcc/../.././gcc/fortran/simplify.c:2500: undefined reference to `mpfr_nextbelow'
/root/gcc-4.1.2/host-x86_64-unknown-linux-gnu/gcc/../.././gcc/fortran/simplify.c:2505: undefined reference to `mpfr_nextabove'
/root/gcc-4.1.2/host-x86_64-unknown-linux-gnu/gcc/../.././gcc/fortran/simplify.c:2456: undefined reference to `mpfr_set_erangeflag'
/root/gcc-4.1.2/host-x86_64-unknown-linux-gnu/gcc/../.././gcc/fortran/simplify.c:2469: undefined reference to `mpfr_set_erangeflag'
/root/gcc-4.1.2/host-x86_64-unknown-linux-gnu/gcc/../.././gcc/fortran/simplify.c:2491: undefined reference to `mpfr_set_erangeflag'
/root/gcc-4.1.2/host-x86_64-unknown-linux-gnu/gcc/../.././gcc/fortran/simplify.c:2500: undefined reference to `mpfr_nextabove'
/root/gcc-4.1.2/host-x86_64-unknown-linux-gnu/gcc/../.././gcc/fortran/simplify.c:2499: undefined reference to `mpfr_nextbelow'
/root/gcc-4.1.2/host-x86_64-unknown-linux-gnu/gcc/../.././gcc/fortran/simplify.c:2505: undefined reference to `mpfr_nextbelow'
/root/gcc-4.1.2/host-x86_64-unknown-linux-gnu/gcc/../.././gcc/fortran/simplify.c:2505: undefined reference to `mpfr_set_erangeflag'
/root/gcc-4.1.2/host-x86_64-unknown-linux-gnu/gcc/../.././gcc/fortran/simplify.c:2499: undefined reference to `mpfr_set_erangeflag'
/root/gcc-4.1.2/host-x86_64-unknown-linux-gnu/gcc/../.././gcc/fortran/simplify.c:2500: undefined reference to `mpfr_set_erangeflag'
fortran/simplify.o: In function `gfc_simplify_modulo':
/root/gcc-4.1.2/host-x86_64-unknown-linux-gnu/gcc/../.././gcc/fortran/simplify.c:2400: undefined reference to `mpfr_set_erangeflag'
fortran/simplify.o: In function `gfc_simplify_mod':
/root/gcc-4.1.2/host-x86_64-unknown-linux-gnu/gcc/../.././gcc/fortran/simplify.c:2340: undefined reference to `mpfr_set_erangeflag'
fortran/simplify.o:/root/gcc-4.1.2/host-x86_64-unknown-linux-gnu/gcc/../.././gcc/fortran/simplify.c:2152: more undefined references to `mpfr_set_erangeflag' follow
collect2: ld returned 1 exit status
make[2]: *** [f951] Error 1
make[2]: Leaving directory `/root/gcc-4.1.2/host-x86_64-unknown-linux-gnu/gcc'
make[1]: *** [all-gcc] Error 2
make[1]: Leaving directory `/root/gcc-4.1.2'
make: *** [all] Error 2
应该怎么解决的。现在一头雾水!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
libmpfr-dev
没有找到mpfr库,gcc 4.0之后需要安装该库和gmp库,并在configure中使用--with-gmp=... --with-mpfr=...来指定路径。
另外,还可能需要环境变量 LD_LIBRARY_PATH 来指定动态库的位置。
如果你不用Fortran的话,指定--enable-languages=c(你想的语言),看情况不是mpfc的问题,如果是它的问题的话,configure不会过的。应该是代码中Fortran的问题