1、安装f77

如果用FC5,安装软件包:compat-gcc-32-g77
(命令:

1
yum install compat-gcc-32-g77

如果用FC6及以上,安装软件包:compat-gcc-32-g77
(命令:

1
yum install compat-gcc-34-g77

2、error while loading shared libraries: libstdc++.so.5

yum install libstdc++.so.5

3、error while loading shared libraries: libmysqlclient_r.so.15: wrong ELF class: LFCLASS64

该问题是由32bit的程序读取64bit的so.15引起的,此处是以32bit的fgn_switch.new程序读取64bit的mysql模块libmysqlclient_r.so.15为例,其他程序读取其他模块引起的wrong ELF class: LFCLASS64可按照此思路做类似调整。

A.确认当前运行的程序是32位还是64位

[root@localhost fgn_switch]# file fgn_switch.new
fgn_switch.new: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not stripped

B.确认当前程序是否正常调用的动态链接库

[root@localhost fgn_switch]# ldd /fgn/fgn_switch/fgn_switch.new
linux-gate.so.1 =>  (0xffffe000)
libcrypt.so.1 => /lib/libcrypt.so.1 (0x006d7000)
libdl.so.2 => /lib/libdl.so.2 (0xf7f65000)
libpthread.so.0 => /lib/libpthread.so.0 (0xf7f4e000)
libnsl.so.1 => /lib/libnsl.so.1 (0x0080b000)
libresolv.so.2 => /lib/libresolv.so.2 (0x0070b000)
libutil.so.1 => /lib/libutil.so.1 (0xf7f4a000)
libcap.so.1 => /lib/libcap.so.1 (0xf7f45000)
    libmysqlclient_r.so.15 => not found
libz.so.1 => /usr/lib/libz.so.1 (0x00bf4000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xf7e5a000)
libm.so.6 => /lib/libm.so.6 (0xf7e33000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00a0f000)
libc.so.6 => /lib/libc.so.6 (0×00592000)
/lib/ld-linux.so.2 (0×00574000)

C.查看当前现有可用的动态链接库

[root@localhost fgn_switch]# ldconfig -p| grep mysql
libmysqlclient_r.so.15 (libc6,x86-64) => /usr/lib/libmysqlclient_r.so.15
libmysqlclient.so.16 (libc6,x86-64) => /usr/lib64/libmysqlclient.so.16

发现当前调用的动态链接库是64 bit,这是导致问题发生的根本原因

解决办法:

从mysql lib目录下找到
[root@localhost fgn_switch]# file /usr/lib/mysql/libmysqlclient_r.so.15
/usr/lib/mysql/libmysqlclient_r.so.15: symbolic link to `/usr/lib/mysql/libmysqlclient_r.so.15.0.0′
[root@localhost fgn_switch]# file /usr/lib/mysql/libmysqlclient_r.so.15.0.0
/usr/lib/mysql/libmysqlclient_r.so.15.0.0: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), stripped

参考:http://my.oschina.net/captaintheron/blog/3974?from=rss

最后更新: 2019年04月19日 21:37

原始链接: http://andersjing.com/2015/05/01/2015-05-01-CentOS_6.5_64bit/

× 请打赏~
打赏二维码