As mentioned in the cppkafka official GitHub in usage section.
If you want to use cppkafka, you'll need to link your application with:
- cppkafka
- rdkafka
I tried to compile example program mentioned in the README.md of the GitHub with
gcc -O3 -Wall test.cpp -std=c++11 -lrdkafka -lpthread -lz -lstdc++ -D_GLIBCXX_USE_CXX11_ABI=0 -lcppkafka
It is throwing with following error
test.cpp:(.text.startup+0x46): undefined reference to `cppkafka::ConfigurationOption::ConfigurationOption(std::string const&, char const*)'
test.cpp:(.text.startup+0xd9): undefined reference to `cppkafka::Buffer::Buffer(std::string const&)'
collect2: error: ld returned 1 exit status