码迷,mamicode.com
首页 > 其他好文 > 详细

libtommath.a: could not read symbols: Bad value 编译错误

时间:2018-01-16 18:08:29      阅读:184      评论:0      收藏:0      [点我收藏+]

标签:usr   red   file   64位   obj   could not   环境   symbols   ati   

最近做个项目需要RSA,便调用了tommath,平时开发环境都在32位的系统上,编译运行一切都没问题,但当把程序换到一台64位系统上编译时出现:

/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/libtommath.a(bn_mp_init.o): relocation R_X86_64_32 against `a local symbol’ can not be used when making a shared object; recompile with -fPIC/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/libtommath.a: could not read symbols: Bad value

看来在64位系统编译libtommath时需要加-fPIC,于是修改makefile在CFLAGS里追加上-fPIC,重新编译libtommath后安装,此时再编译自己的程序,问题解决!

libtommath.a: could not read symbols: Bad value 编译错误

标签:usr   red   file   64位   obj   could not   环境   symbols   ati   

原文地址:https://www.cnblogs.com/xiaoleiel/p/8296300.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!