为了账号安全,请及时绑定邮箱和手机立即绑定

无法读取 librdkafka 文件,显示对“rd_kafka_header_get_all”

无法读取 librdkafka 文件,显示对“rd_kafka_header_get_all”

Go
DIEA 2023-07-26 16:32:48
我正在尝试设置我的项目并尝试进行构建或尝试运行,但每次它都会显示此错误未定义的引用。到目前为止我了解到我的代码无法读取 librdkafka 的文件。我尝试更改安装这些工具或库的位置,尝试更改它们的版本,但没有成功解决它。这些是库安装的位置。/opt/apache-zookeeper-3.5.5-bin /opt/zookeeper/home/harishrana/go/src/github.com/confluentinc/confluent-kafka-go/home/harishrana/librdkafka这就是我的项目所在的位置。/home/harishrana/go/src/autoextraction这是出现的错误/usr/local/go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1/tmp/go-link-908398633/000019.o: In function `_cgo_a32e55418a84_Cfunc_rd_kafka_AlterConfigs_result_resources':/tmp/go-build/cgo-gcc-prolog:124: undefined reference to `rd_kafka_AlterConfigs_result_resources'/tmp/go-link-908398633/000019.o: In function `_cgo_a32e55418a84_Cfunc_rd_kafka_ConfigEntry_is_read_only':/tmp/go-build/cgo-gcc-prolog:143: undefined reference to `rd_kafka_ConfigEntry_is_read_only'/tmp/go-link-908398633/000019.o: In function `_cgo_a32e55418a84_Cfunc_rd_kafka_ConfigEntry_is_sensitive':/tmp/go-build/cgo-gcc-prolog:162: undefined reference to `rd_kafka_ConfigEntry_is_sensitive'/tmp/go-link-908398633/000019.o: In function `_cgo_a32e55418a84_Cfunc_rd_kafka_ConfigEntry_is_synonym':/tmp/go-build/cgo-gcc-prolog:181: undefined reference to `rd_kafka_ConfigEntry_is_synonym'/tmp/go-link-908398633/000019.o: In function `_cgo_a32e55418a84_Cfunc_rd_kafka_ConfigEntry_name':/tmp/go-build/cgo-gcc-prolog:199: undefined reference to `rd_kafka_ConfigEntry_name'/tmp/go-link-908398633/000019.o: In function `_cgo_a32e55418a84_Cfunc_rd_kafka_ConfigEntry_source':/tmp/go-build/cgo-gcc-prolog:218: undefined reference to `rd_kafka_ConfigEntry_source'/tmp/go-link-908398633/000019.o: In function `_cgo_a32e55418a84_Cfunc_rd_kafka_ConfigEntry_synonyms':/tmp/go-build/cgo-gcc-prolog:237: undefined ref
查看完整描述

1 回答

?
HUH函数

TA贡献1836条经验 获得超4个赞

这绝对是librdkafka版本的问题。可以从源码下载吗?


应遵循的步骤:


git clone https://github.com/edenhill/librdkafka.git

cd librdkafka

./configure --prefix /usr

make

sudo make install


查看完整回答
反对 回复 2023-07-26
  • 1 回答
  • 0 关注
  • 208 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信