【go-kafka】librdkafka 安装及运行错误
安装错误:#错误rdkafka_topic.c:321:59: error: 'Z_DEFAULT_COMPRESSION' dndeclared (fitrst use in this function)#原因:缺少zlib-devel库,编译不通过。查询zlib相关安装包可以看到zlib-devel没有安装[root@localhost ~]# rpm -qa|grep z...
·
安装错误:
#错误
rdkafka_topic.c:321:59: error: 'Z_DEFAULT_COMPRESSION' dndeclared (fitrst use in this function)
#原因:
缺少zlib-devel库,编译不通过。
查询zlib相关安装包可以看到zlib-devel没有安装
[root@localhost ~]# rpm -qa|grep zlib
zlib-1.2.7-17.el7.x86_64
#解决方法:
yum install zlib-devel -y
运行错误:
#错误
./infocenter: error while loading shared libraries: librdkafka.so.1:
cannot open shared object file: No such file or directory
#原因:
64位系统,在/usr/lib64路径没有找到库
[root@localhost infocenter]# ll /usr/lib64/librdkafka*
然后在/usr/lib下找到
[root@localhost infocenter]# ll /usr/lib/librdkafka*
-rwxr-xr-x. 1 root root 14194266 Jul 2 17:50 /usr/lib/librdkafka.a
-rwxr-xr-x. 1 root root 2492808 Jul 2 17:50 /usr/lib/librdkafka++.a
lrwxrwxrwx. 1 root root 15 Jul 2 17:50 /usr/lib/librdkafka.so -> librdkafka.so.1
lrwxrwxrwx. 1 root root 17 Jul 2 17:50 /usr/lib/librdkafka++.so -> librdkafka++.so.1
-rwxr-xr-x. 1 root root 5750088 Jul 2 17:50 /usr/lib/librdkafka.so.1
-rwxr-xr-x. 1 root root 963968 Jul 2 17:50 /usr/lib/librdkafka++.so.1
#解决方法:
cp /usr/lib/librdkafka* /usr/lib64/
更多推荐
已为社区贡献4条内容
所有评论(0)