as: error while loading shared libraries: /usr/lib64/libopcodes-2.20.51.0.2-5.44.el6.so: file too sh

编译c文件发现这错误

as: error while loading shared libraries: /usr/lib64/libopcodes-2.20.51.0.2-5.44.el6.so: file too short

通过/sbin/ldconfig -v查询发现情况如下

/sbin/ldconfig: File /usr/lib64/libbfd-2.20.51.0.2-5.44.el6.so is empty, not checked.
/sbin/ldconfig: File /usr/lib64/libsss_idmap.so.0.5.0 is empty, not checked.
/sbin/ldconfig: File /usr/lib64/libopcodes-2.20.51.0.2-5.44.el6.so is empty, not checked.
/sbin/ldconfig: File /usr/lib64/libasm-0.164.so is empty, not checked.
/sbin/ldconfig: File /usr/lib64/libdw-0.164.so is empty, not checked.

查询发现这几个包都是为空的文件

[root@localhost inotify-tools-3.14]# ll /usr/lib64/libopcodes-2.20.51.0.2-5.44.el6.so
-rwxr-xr-x. 1 root root 0 May 11 03:12 /usr/lib64/libopcodes-2.20.51.0.2-5.44.el6.so

解决办法

从别的机器上把这个文件拷贝过来

 scp -p22 root@192.168.1.252:/usr/lib64/libopcodes-2.20.51.0.2-5.44.el6.so /usr/lib64/

查看

[root@localhost inotify-tools-3.14]# ll /usr/lib64/libopcodes-2.20.51.0.2-5.44.el6.so             

 -rwxr-xr-x. 1 root root 990040 May 11 03:12 /usr/lib64/libopcodes-2.20.51.0.2-5.44.el6.so


再进行运行查看是否还会报错


[root@localhost ~]# gcc hello.c 
as: error while loading shared libraries: /usr/lib64/libbfd-2.20.51.0.2-5.44.el6.so: file too short

把文件拷过来

[root@localhost ~]# scp -p22 root@192.168.1.252:/usr/lib64/libbfd-2.20.51.0.2-5.44.el6.so /usr/lib64/
root@192.168.1.252's password: 
libbfd-2.20.51.0.2-5.44.el6.so                                   100%  927KB 927.5KB/s   00:00    
[root@localhost ~]# gcc hello.c 
[root@localhost ~]# 


因为这两个文件也导致gcc无法运行

编译时,会报如下错误


checking for gcc... gcc
checking for C compiler default output file name... 
configure: error: in `/home/whl/tools/inotify-tools-3.14':
configure: error: C compiler cannot create executables
See `config.log' for more details.

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值