confluent-kafka-go: Could not determine kind of name for C.RD_KAFKA_EVENT_STATS

Pulled latest changes. when i am trying run go code getting this error could not determine kind of name for C.RD_KAFKA_EVENT_STATS

Here my machine configuration

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/rb/workspace"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.8.1/libexec"
GOTOOLDIR="/usr/local/Cellar/go/1.8.1/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/jm/rf97g_5d6p91cpp6s_jgzn140000gn/T/go-build788309128=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 16 (7 by maintainers)

Most upvoted comments

pkg-config will need to find the rdkafka.pc file that is installed when you do ‘make install’ in librdkafka, the location depends on ./configure --prefix and defaults to /usr/local. It might be the case that /usr/local is not in your PKG_CONFIG_PATH, the easiest fix is to install librdkafka into /usr, like this:

$ ./configure --prefix /usr
$ make
$ sudo make install

@mewwts The master branch of the Go client requires the master branch of librdkafka (the development is kept in synch).

So you have two options:

  • use the latest release of the Go client (v0.9.4) with a recent release of librdkafka (>=v0.9.4)
  • remove any installed versions of librdkafka, clone librdkafka master and build and install it.

That looks like it is finding librdkafka >0.11.0 when compiling (rdkafka.h header file) but not when linking (library file).

I suggest removing all installed versions of librdkafka from your system, using both your package manager and by searching for rdkafka.h and librdkafka.so*.

Then build and install librdkafka 0.11.3 (latest version) and then rebuild the Go client (go clean -i ./... first).

@liaoyizhe Make sure to install librdkafka v0.11.0 as instructed here: https://github.com/confluentinc/confluent-kafka-go/#installing-librdkafka

Thanks, i got working 👍

Hi,… You need to build and install librdkafka master, or use go client release 0.9.4

Den 11 maj 2017 1:27 em skrev “Ram Bharose Rana” notifications@github.com:

Pulled latest changes. when i am trying run go code getting this error could not determine kind of name for C.RD_KAFKA_EVENT_STATS

Here my machine configuration

GOARCH=“amd64” GOBIN=“” GOEXE=“” GOHOSTARCH=“amd64” GOHOSTOS=“darwin” GOOS=“darwin” GOPATH=“/Users/rb/workspace” GORACE=“” GOROOT=“/usr/local/Cellar/go/1.8.1/libexec” GOTOOLDIR=“/usr/local/Cellar/go/1.8.1/libexec/pkg/tool/darwin_amd64” GCCGO=“gccgo” CC=“clang” GOGCCFLAGS=“-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/jm/rf97g_5d6p91cpp6s_jgzn140000gn/T/go-build788309128=/tmp/go-build -gno-record-gcc-switches -fno-common” CXX=“clang++” CGO_ENABLED=“1” PKG_CONFIG=“pkg-config” CGO_CFLAGS=“-g -O2” CGO_CPPFLAGS=“” CGO_CXXFLAGS=“-g -O2” CGO_FFLAGS=“-g -O2” CGO_LDFLAGS=“-g -O2”

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/confluentinc/confluent-kafka-go/issues/61, or mute the thread https://github.com/notifications/unsubscribe-auth/AAgCvrtTYMPgcY4dhBOZOG03UdO2zSnCks5r4vCQgaJpZM4NX3NV .