error while loading shared libraries: libmysqlclient_r.so.15: wrong ELF class: ELFCLASS64

原创
2010/04/19 23:52
阅读数 1W

运行程序出问题:

1.确认当前运行的程序是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

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

[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 (0x00592000)
    /lib/ld-linux.so.2 (0x00574000)

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

[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

展开阅读全文
打赏
1
1 收藏
分享
加载中
你好!没有后续了吗?解决办法就这样?没看见怎么解决的啊
2011/09/23 08:38
回复
举报
更多评论
打赏
1 评论
1 收藏
1
分享
返回顶部
顶部