librdkafka linux编译方法

1.安装librdkafka 

   github下载源代码 编译

   参考example写测试代码 example只带文件可直接执行

   写好后运行

   echo "/usr/local/lib" >> /etc/ld.so.conf

    ldconfig

    编译语句示例

    gcc test_consumer.c -o test -lrdkafka -lz -lpthread -lrt

    加后部分   -lrdkafka -lz -lpthread -lrt

2. librdkafka结构体关系表(用于源代码学习顺序参考)

 

posted @ 2022-03-22 17:15  Aemnprsu_wx  阅读(383)  评论(0编辑  收藏  举报