Chinaunix首页 | 论坛 | 博客
  • 博客访问: 130145
  • 博文数量: 25
  • 博客积分: 290
  • 博客等级: 二等列兵
  • 技术积分: 210
  • 用 户 组: 普通用户
  • 注册时间: 2008-01-30 23:13
文章分类

全部博文(25)

文章存档

2015年(10)

2014年(7)

2011年(3)

2010年(1)

2008年(4)

我的朋友

分类: 数据库开发技术

2011-07-04 10:16:03

/usr/bin/ld: skipping incompatible /usr/lib/libhiredis.so when searching for -lhiredis
/usr/bin/ld: cannot find -lhiredis
collect2: ld returned 1 exit status
make: *** [bin/Debug/Server] 错误 1


跳过不匹配的库 * ,当查找库 * 时
库链接失败。

可能的原因:
1.版本不兼容。
2.编译库的编译器和现在用的编译器不一致。

/usr/lib/libhiredis.so 是用GCC 4.4.3 编译的,现在换到gcc 4.5.2 上去就出现这个问题,把redis的源码找到重新编译一下,就解决了


具体方法如下

git clone

cd redis
make
cd deps
ln -sf /home/xxx/redis/deps/libhiredis /usr/lib/libhiredis
ldconfig


阅读(3918) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~