Comments (8)
Thanks for pointing that out! The compilation worked after installing librdkafka
v1.8.2
from source and running:
./configure --install-deps
make
make install
Thanks again for the help. Have a nice day
from modern-cpp-kafka.
Hi, @jianali the headers only partially support C++14, -- GCC only (with optimization, e.g. -O2), https://github.com/morganstanley/modern-cpp-kafka#install
Please just try with C++17, which should fix your problem.
from modern-cpp-kafka.
I have a similar issue unfortunately..
Using Ubuntu 20.04
librdkafka-dev
version 1.2.1-1ubuntu1
Compiling with -std=c++17
would not solve the issue. Any help is much appreciated
from modern-cpp-kafka.
I have a similar issue unfortunately.. Using Ubuntu 20.04
librdkafka-dev
version1.2.1-1ubuntu1
Compiling with-std=c++17
would not solve the issue. Any help is much appreciated
Could you please help attach the compile log which shows the build options clang++
were using? Thanks!
from modern-cpp-kafka.
Thanks a lot for the prompt response! Here is the compile log:
gcc -std=c++17 -I include/ KafkaConsumer.cpp -lrdkafka++ -lrt -lpthread
In file included from include/kafka/Error.h:5,
from include/kafka/ConsumerCommon.h:5,
from include/kafka/KafkaConsumer.h:5,
from KafkaConsumer.cpp:1:
include/kafka/RdKafkaHelper.h:72:25: error: 'rd_kafka_DeleteRecords_t' has not been declared
72 | void operator()(rd_kafka_DeleteRecords_t *p) { rd_kafka_DeleteRecords_destroy(p); }
| ^~~~~~~~~~~~~~~~~~~~~~~~
include/kafka/RdKafkaHelper.h: In member function 'void kafka::RkDeleteRecordsDeleter::operator()(int*)':
include/kafka/RdKafkaHelper.h:72:56: error: 'rd_kafka_DeleteRecords_destroy' was not declared in this scope; did you mean 'rd_kafka_DeleteTopic_destroy'?
72 | void operator()(rd_kafka_DeleteRecords_t *p) { rd_kafka_DeleteRecords_destroy(p); }
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| rd_kafka_DeleteTopic_destroy
include/kafka/RdKafkaHelper.h: At global scope:
include/kafka/RdKafkaHelper.h:74:63: error: 'rd_kafka_DeleteRecords_t' was not declared in this scope; did you mean 'rd_kafka_DeleteTopic_t'?
74 | using rd_kafka_DeleteRecords_unique_ptr = std::unique_ptr<rd_kafka_DeleteRecords_t, RkDeleteRecordsDeleter>;
| ^~~~~~~~~~~~~~~~~~~~~~~~
| rd_kafka_DeleteTopic_t
include/kafka/RdKafkaHelper.h:74:111: error: template argument 1 is invalid
74 | using rd_kafka_DeleteRecords_unique_ptr = std::unique_ptr<rd_kafka_DeleteRecords_t, RkDeleteRecordsDeleter>;
| ^
include/kafka/RdKafkaHelper.h:78:25: error: 'rd_kafka_consumer_group_metadata_t' has not been declared
78 | void operator()(rd_kafka_consumer_group_metadata_t *p) { rd_kafka_consumer_group_metadata_destroy(p); }
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/kafka/RdKafkaHelper.h: In member function 'void kafka::RkConsumerGroupMetadataDeleter::operator()(int*)':
include/kafka/RdKafkaHelper.h:78:66: error: 'rd_kafka_consumer_group_metadata_destroy' was not declared in this scope
78 | void operator()(rd_kafka_consumer_group_metadata_t *p) { rd_kafka_consumer_group_metadata_destroy(p); }
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/kafka/RdKafkaHelper.h: At global scope:
include/kafka/RdKafkaHelper.h:80:73: error: 'rd_kafka_consumer_group_metadata_t' was not declared in this scope
80 | using rd_kafka_consumer_group_metadata_unique_ptr = std::unique_ptr<rd_kafka_consumer_group_metadata_t, RkConsumerGroupMetadataDeleter>;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/kafka/RdKafkaHelper.h:80:139: error: template argument 1 is invalid
80 | using rd_kafka_consumer_group_metadata_unique_ptr = std::unique_ptr<rd_kafka_consumer_group_metadata_t, RkConsumerGroupMetadataDeleter>;
| ^
include/kafka/RdKafkaHelper.h:82:32: error: variable or field 'RkErrorDeleter' declared void
82 | inline void RkErrorDeleter(rd_kafka_error_t *p) { rd_kafka_error_destroy(p); }
| ^~~~~~~~~~~~~~~~
include/kafka/RdKafkaHelper.h:82:32: error: 'rd_kafka_error_t' was not declared in this scope; did you mean 'rd_kafka_errno'?
82 | inline void RkErrorDeleter(rd_kafka_error_t *p) { rd_kafka_error_destroy(p); }
| ^~~~~~~~~~~~~~~~
| rd_kafka_errno
include/kafka/RdKafkaHelper.h:82:50: error: 'p' was not declared in this scope
82 | inline void RkErrorDeleter(rd_kafka_error_t *p) { rd_kafka_error_destroy(p); }
| ^
include/kafka/RdKafkaHelper.h:83:55: error: 'rd_kafka_error_t' was not declared in this scope; did you mean 'rd_kafka_errno'?
83 | using rd_kafka_error_shared_ptr = std::shared_ptr<rd_kafka_error_t>;
| ^~~~~~~~~~~~~~~~
| rd_kafka_errno
include/kafka/RdKafkaHelper.h:83:71: error: template argument 1 is invalid
83 | using rd_kafka_error_shared_ptr = std::shared_ptr<rd_kafka_error_t>;
| ^
In file included from include/kafka/ConsumerCommon.h:5,
from include/kafka/KafkaConsumer.h:5,
from KafkaConsumer.cpp:1:
include/kafka/Error.h:35:36: error: expected ')' before '*' token
35 | explicit Error(rd_kafka_error_t* error = nullptr): _rkError(error, RkErrorDeleter) {}
| ~ ^
| )
In file included from include/kafka/ConsumerCommon.h:5,
from include/kafka/KafkaConsumer.h:5,
from KafkaConsumer.cpp:1:
include/kafka/Error.h:139:5: error: 'rd_kafka_error_shared_ptr' does not name a type
139 | rd_kafka_error_shared_ptr _rkError; // For error with rich info
| ^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from include/kafka/ConsumerCommon.h:5,
from include/kafka/KafkaConsumer.h:5,
from KafkaConsumer.cpp:1:
include/kafka/Error.h: In member function 'kafka::Error& kafka::Error::operator=(const kafka::Error&)':
include/kafka/Error.h:49:9: error: '_rkError' was not declared in this scope; did you mean 'Error'?
49 | _rkError.reset();
| ^~~~~~~~
| Error
In file included from include/kafka/ConsumerCommon.h:5,
from include/kafka/KafkaConsumer.h:5,
from KafkaConsumer.cpp:1:
include/kafka/Error.h: In member function 'int kafka::Error::value() const':
include/kafka/Error.h:83:33: error: '_rkError' was not declared in this scope; did you mean 'Error'?
83 | return static_cast<int>(_rkError ? rd_kafka_error_code(_rkError.get()) : _respErr);
| ^~~~~~~~
| Error
include/kafka/Error.h:83:44: error: 'rd_kafka_error_code' was not declared in this scope; did you mean 'rd_kafka_produce'?
83 | return static_cast<int>(_rkError ? rd_kafka_error_code(_rkError.get()) : _respErr);
| ^~~~~~~~~~~~~~~~~~~
| rd_kafka_produce
include/kafka/Error.h: In member function 'std::string kafka::Error::message() const':
include/kafka/Error.h:92:19: error: '_rkError' was not declared in this scope; did you mean 'Error'?
92 | (_rkError ? rd_kafka_error_string(_rkError.get()) : rd_kafka_err2str(_respErr));
| ^~~~~~~~
| Error
include/kafka/Error.h:92:30: error: 'rd_kafka_error_string' was not declared in this scope; did you mean 'rd_kafka_event_error_string'?
92 | (_rkError ? rd_kafka_error_string(_rkError.get()) : rd_kafka_err2str(_respErr));
| ^~~~~~~~~~~~~~~~~~~~~
| rd_kafka_event_error_string
include/kafka/Error.h: In member function 'bool kafka::Error::isFatal() const':
include/kafka/Error.h:115:17: error: '_rkError' was not declared in this scope; did you mean 'Error'?
115 | return _rkError ? rd_kafka_error_is_fatal(_rkError.get()) : _isFatal;
| ^~~~~~~~
| Error
include/kafka/Error.h:115:28: error: 'rd_kafka_error_is_fatal' was not declared in this scope; did you mean 'rd_kafka_event_error_is_fatal'?
115 | return _rkError ? rd_kafka_error_is_fatal(_rkError.get()) : _isFatal;
| ^~~~~~~~~~~~~~~~~~~~~~~
| rd_kafka_event_error_is_fatal
include/kafka/Error.h: In member function 'Optional<bool> kafka::Error::isRetriable() const':
include/kafka/Error.h:123:16: error: '_rkError' was not declared in this scope; did you mean 'Error'?
123 | return _rkError ? rd_kafka_error_is_retriable(_rkError.get()) : _isRetriable;
| ^~~~~~~~
| Error
include/kafka/Error.h:123:27: error: 'rd_kafka_error_is_retriable' was not declared in this scope
123 | return _rkError ? rd_kafka_error_is_retriable(_rkError.get()) : _isRetriable;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
include/kafka/Error.h: In member function 'bool kafka::Error::transactionRequiresAbort() const':
include/kafka/Error.h:135:16: error: '_rkError' was not declared in this scope; did you mean 'Error'?
135 | return _rkError ? rd_kafka_error_txn_requires_abort(_rkError.get()) : false;
| ^~~~~~~~
| Error
include/kafka/Error.h:135:27: error: 'rd_kafka_error_txn_requires_abort' was not declared in this scope
135 | return _rkError ? rd_kafka_error_txn_requires_abort(_rkError.get()) : false;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from include/kafka/KafkaConsumer.h:5,
from KafkaConsumer.cpp:1:
include/kafka/ConsumerCommon.h: At global scope:
include/kafka/ConsumerCommon.h:56:74: error: expected ')' before '*' token
56 | explicit ConsumerGroupMetadata(rd_kafka_consumer_group_metadata_t* p): _rkConsumerGroupMetadata(p) {}
| ~ ^
| )
include/kafka/ConsumerCommon.h:58:15: error: 'rd_kafka_consumer_group_metadata_t' does not name a type
58 | const rd_kafka_consumer_group_metadata_t* rawHandle() const { return _rkConsumerGroupMetadata.get(); }
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/kafka/ConsumerCommon.h:61:9: error: 'rd_kafka_consumer_group_metadata_unique_ptr' does not name a type; did you mean 'rd_kafka_metadata_unique_ptr'?
61 | rd_kafka_consumer_group_metadata_unique_ptr _rkConsumerGroupMetadata;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| rd_kafka_metadata_unique_ptr
In file included from include/kafka/KafkaConsumer.h:9,
from KafkaConsumer.cpp:1:
include/kafka/KafkaClient.h: In static member function 'static void kafka::clients::KafkaClient::errorCallback(rd_kafka_t*, int, const char*, void*)':
include/kafka/KafkaClient.h:523:11: error: no matching function for call to 'kafka::Error::Error()'
523 | Error error;
| ^~~~~
In file included from include/kafka/ConsumerCommon.h:5,
from include/kafka/KafkaConsumer.h:5,
from KafkaConsumer.cpp:1:
include/kafka/Error.h:42:5: note: candidate: 'kafka::Error::Error(const kafka::Error&)'
42 | Error(const Error& error) { *this = error; }
| ^~~~~
include/kafka/Error.h:42:5: note: candidate expects 1 argument, 0 provided
include/kafka/Error.h:39:5: note: candidate: 'kafka::Error::Error(rd_kafka_resp_err_t, std::string, bool)'
39 | Error(rd_kafka_resp_err_t respErr, std::string message, bool fatal = false)
| ^~~~~
include/kafka/Error.h:39:5: note: candidate expects 3 arguments, 0 provided
include/kafka/Error.h:37:14: note: candidate: 'kafka::Error::Error(rd_kafka_resp_err_t)'
37 | explicit Error(rd_kafka_resp_err_t respErr): _respErr(respErr) {}
| ^~~~~
include/kafka/Error.h:37:14: note: candidate expects 1 argument, 0 provided
In file included from KafkaConsumer.cpp:1:
include/kafka/KafkaConsumer.h: In member function 'void kafka::clients::KafkaConsumer::changeAssignment(kafka::clients::KafkaConsumer::PartitionsRebalanceEvent, const TopicPartitions&)':
include/kafka/KafkaConsumer.h:566:11: error: no matching function for call to 'kafka::Error::Error()'
566 | Error result;
| ^~~~~~
In file included from include/kafka/ConsumerCommon.h:5,
from include/kafka/KafkaConsumer.h:5,
from KafkaConsumer.cpp:1:
include/kafka/Error.h:42:5: note: candidate: 'kafka::Error::Error(const kafka::Error&)'
42 | Error(const Error& error) { *this = error; }
| ^~~~~
include/kafka/Error.h:42:5: note: candidate expects 1 argument, 0 provided
include/kafka/Error.h:39:5: note: candidate: 'kafka::Error::Error(rd_kafka_resp_err_t, std::string, bool)'
39 | Error(rd_kafka_resp_err_t respErr, std::string message, bool fatal = false)
| ^~~~~
include/kafka/Error.h:39:5: note: candidate expects 3 arguments, 0 provided
include/kafka/Error.h:37:14: note: candidate: 'kafka::Error::Error(rd_kafka_resp_err_t)'
37 | explicit Error(rd_kafka_resp_err_t respErr): _respErr(respErr) {}
| ^~~~~
include/kafka/Error.h:37:14: note: candidate expects 1 argument, 0 provided
In file included from KafkaConsumer.cpp:1:
include/kafka/KafkaConsumer.h:582:29: error: 'rd_kafka_incremental_assign' was not declared in this scope
582 | result = Error{ rd_kafka_incremental_assign(getClientHandle(), rk_tps.get()) };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
include/kafka/KafkaConsumer.h:582:90: error: no matching function for call to 'kafka::Error::Error(<brace-enclosed initializer list>)'
582 | result = Error{ rd_kafka_incremental_assign(getClientHandle(), rk_tps.get()) };
| ^
In file included from include/kafka/ConsumerCommon.h:5,
from include/kafka/KafkaConsumer.h:5,
from KafkaConsumer.cpp:1:
include/kafka/Error.h:42:5: note: candidate: 'kafka::Error::Error(const kafka::Error&)'
42 | Error(const Error& error) { *this = error; }
| ^~~~~
include/kafka/Error.h:42:5: note: conversion of argument 1 would be ill-formed:
include/kafka/Error.h:39:5: note: candidate: 'kafka::Error::Error(rd_kafka_resp_err_t, std::string, bool)'
39 | Error(rd_kafka_resp_err_t respErr, std::string message, bool fatal = false)
| ^~~~~
include/kafka/Error.h:39:5: note: candidate expects 3 arguments, 1 provided
include/kafka/Error.h:37:14: note: candidate: 'kafka::Error::Error(rd_kafka_resp_err_t)'
37 | explicit Error(rd_kafka_resp_err_t respErr): _respErr(respErr) {}
| ^~~~~
include/kafka/Error.h:37:14: note: conversion of argument 1 would be ill-formed:
In file included from KafkaConsumer.cpp:1:
include/kafka/KafkaConsumer.h:598:29: error: 'rd_kafka_incremental_unassign' was not declared in this scope
598 | result = Error{ rd_kafka_incremental_unassign(getClientHandle(), rk_tps.get()) };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/kafka/KafkaConsumer.h:598:92: error: no matching function for call to 'kafka::Error::Error(<brace-enclosed initializer list>)'
598 | result = Error{ rd_kafka_incremental_unassign(getClientHandle(), rk_tps.get()) };
| ^
In file included from include/kafka/ConsumerCommon.h:5,
from include/kafka/KafkaConsumer.h:5,
from KafkaConsumer.cpp:1:
include/kafka/Error.h:42:5: note: candidate: 'kafka::Error::Error(const kafka::Error&)'
42 | Error(const Error& error) { *this = error; }
| ^~~~~
include/kafka/Error.h:42:5: note: conversion of argument 1 would be ill-formed:
include/kafka/Error.h:39:5: note: candidate: 'kafka::Error::Error(rd_kafka_resp_err_t, std::string, bool)'
39 | Error(rd_kafka_resp_err_t respErr, std::string message, bool fatal = false)
| ^~~~~
include/kafka/Error.h:39:5: note: candidate expects 3 arguments, 1 provided
include/kafka/Error.h:37:14: note: candidate: 'kafka::Error::Error(rd_kafka_resp_err_t)'
37 | explicit Error(rd_kafka_resp_err_t respErr): _respErr(respErr) {}
| ^~~~~
include/kafka/Error.h:37:14: note: conversion of argument 1 would be ill-formed:
In file included from KafkaConsumer.cpp:1:
include/kafka/KafkaConsumer.h: In member function 'void kafka::clients::KafkaConsumer::commit(const TopicPartitionOffsets&, kafka::clients::KafkaConsumer::CommitType)':
include/kafka/KafkaConsumer.h:760:23: error: no matching function for call to 'kafka::Error::Error(<brace-enclosed initializer list>)'
760 | error = Error{};
| ^
In file included from include/kafka/ConsumerCommon.h:5,
from include/kafka/KafkaConsumer.h:5,
from KafkaConsumer.cpp:1:
include/kafka/Error.h:42:5: note: candidate: 'kafka::Error::Error(const kafka::Error&)'
42 | Error(const Error& error) { *this = error; }
| ^~~~~
include/kafka/Error.h:42:5: note: candidate expects 1 argument, 0 provided
include/kafka/Error.h:39:5: note: candidate: 'kafka::Error::Error(rd_kafka_resp_err_t, std::string, bool)'
39 | Error(rd_kafka_resp_err_t respErr, std::string message, bool fatal = false)
| ^~~~~
include/kafka/Error.h:39:5: note: candidate expects 3 arguments, 0 provided
include/kafka/Error.h:37:14: note: candidate: 'kafka::Error::Error(rd_kafka_resp_err_t)'
37 | explicit Error(rd_kafka_resp_err_t respErr): _respErr(respErr) {}
| ^~~~~
include/kafka/Error.h:37:14: note: candidate expects 1 argument, 0 provided
In file included from KafkaConsumer.cpp:1:
include/kafka/KafkaConsumer.h: In member function 'void kafka::clients::KafkaConsumer::onRebalance(rd_kafka_resp_err_t, rd_kafka_topic_partition_list_t*)':
include/kafka/KafkaConsumer.h:915:36: error: 'rd_kafka_rebalance_protocol' was not declared in this scope
915 | if (const char* protocol = rd_kafka_rebalance_protocol(getClientHandle()))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
include/kafka/KafkaConsumer.h: In member function 'kafka::clients::consumer::ConsumerGroupMetadata kafka::clients::KafkaConsumer::groupMetadata()':
include/kafka/KafkaConsumer.h:987:44: error: 'rd_kafka_consumer_group_metadata' was not declared in this scope
987 | return consumer::ConsumerGroupMetadata{rd_kafka_consumer_group_metadata(getClientHandle())};
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
from modern-cpp-kafka.
Hi, @rbngz I see, your problem was caused by gcc
(the compiler for c
, not for c++
), why not call g++
instead?
from modern-cpp-kafka.
@kenneth-jia good point! I have tried that earlier but received the same output:
g++ -std=c++17 -I include/ KafkaConsumer.cpp -lrdkafka++ -lrt -lpthread
In file included from include/kafka/Error.h:5,
from include/kafka/ConsumerCommon.h:5,
from include/kafka/KafkaConsumer.h:5,
from KafkaConsumer.cpp:1:
include/kafka/RdKafkaHelper.h:72:25: error: 'rd_kafka_DeleteRecords_t' has not been declared
72 | void operator()(rd_kafka_DeleteRecords_t *p) { rd_kafka_DeleteRecords_destroy(p); }
| ^~~~~~~~~~~~~~~~~~~~~~~~
include/kafka/RdKafkaHelper.h: In member function 'void kafka::RkDeleteRecordsDeleter::operator()(int*)':
include/kafka/RdKafkaHelper.h:72:56: error: 'rd_kafka_DeleteRecords_destroy' was not declared in this scope; did you mean 'rd_kafka_DeleteTopic_destroy'?
72 | void operator()(rd_kafka_DeleteRecords_t *p) { rd_kafka_DeleteRecords_destroy(p); }
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| rd_kafka_DeleteTopic_destroy
include/kafka/RdKafkaHelper.h: At global scope:
include/kafka/RdKafkaHelper.h:74:63: error: 'rd_kafka_DeleteRecords_t' was not declared in this scope; did you mean 'rd_kafka_DeleteTopic_t'?
74 | using rd_kafka_DeleteRecords_unique_ptr = std::unique_ptr<rd_kafka_DeleteRecords_t, RkDeleteRecordsDeleter>;
| ^~~~~~~~~~~~~~~~~~~~~~~~
| rd_kafka_DeleteTopic_t
include/kafka/RdKafkaHelper.h:74:111: error: template argument 1 is invalid
74 | using rd_kafka_DeleteRecords_unique_ptr = std::unique_ptr<rd_kafka_DeleteRecords_t, RkDeleteRecordsDeleter>;
| ^
include/kafka/RdKafkaHelper.h:78:25: error: 'rd_kafka_consumer_group_metadata_t' has not been declared
78 | void operator()(rd_kafka_consumer_group_metadata_t *p) { rd_kafka_consumer_group_metadata_destroy(p); }
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/kafka/RdKafkaHelper.h: In member function 'void kafka::RkConsumerGroupMetadataDeleter::operator()(int*)':
include/kafka/RdKafkaHelper.h:78:66: error: 'rd_kafka_consumer_group_metadata_destroy' was not declared in this scope
78 | void operator()(rd_kafka_consumer_group_metadata_t *p) { rd_kafka_consumer_group_metadata_destroy(p); }
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/kafka/RdKafkaHelper.h: At global scope:
include/kafka/RdKafkaHelper.h:80:73: error: 'rd_kafka_consumer_group_metadata_t' was not declared in this scope
80 | using rd_kafka_consumer_group_metadata_unique_ptr = std::unique_ptr<rd_kafka_consumer_group_metadata_t, RkConsumerGroupMetadataDeleter>;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/kafka/RdKafkaHelper.h:80:139: error: template argument 1 is invalid
80 | using rd_kafka_consumer_group_metadata_unique_ptr = std::unique_ptr<rd_kafka_consumer_group_metadata_t, RkConsumerGroupMetadataDeleter>;
| ^
include/kafka/RdKafkaHelper.h:82:32: error: variable or field 'RkErrorDeleter' declared void
82 | inline void RkErrorDeleter(rd_kafka_error_t *p) { rd_kafka_error_destroy(p); }
| ^~~~~~~~~~~~~~~~
include/kafka/RdKafkaHelper.h:82:32: error: 'rd_kafka_error_t' was not declared in this scope; did you mean 'rd_kafka_errno'?
82 | inline void RkErrorDeleter(rd_kafka_error_t *p) { rd_kafka_error_destroy(p); }
| ^~~~~~~~~~~~~~~~
| rd_kafka_errno
include/kafka/RdKafkaHelper.h:82:50: error: 'p' was not declared in this scope
82 | inline void RkErrorDeleter(rd_kafka_error_t *p) { rd_kafka_error_destroy(p); }
| ^
include/kafka/RdKafkaHelper.h:83:55: error: 'rd_kafka_error_t' was not declared in this scope; did you mean 'rd_kafka_errno'?
83 | using rd_kafka_error_shared_ptr = std::shared_ptr<rd_kafka_error_t>;
| ^~~~~~~~~~~~~~~~
| rd_kafka_errno
include/kafka/RdKafkaHelper.h:83:71: error: template argument 1 is invalid
83 | using rd_kafka_error_shared_ptr = std::shared_ptr<rd_kafka_error_t>;
| ^
In file included from include/kafka/ConsumerCommon.h:5,
from include/kafka/KafkaConsumer.h:5,
from KafkaConsumer.cpp:1:
include/kafka/Error.h:35:36: error: expected ')' before '*' token
35 | explicit Error(rd_kafka_error_t* error = nullptr): _rkError(error, RkErrorDeleter) {}
| ~ ^
| )
In file included from include/kafka/ConsumerCommon.h:5,
from include/kafka/KafkaConsumer.h:5,
from KafkaConsumer.cpp:1:
include/kafka/Error.h:139:5: error: 'rd_kafka_error_shared_ptr' does not name a type
139 | rd_kafka_error_shared_ptr _rkError; // For error with rich info
| ^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from include/kafka/ConsumerCommon.h:5,
from include/kafka/KafkaConsumer.h:5,
from KafkaConsumer.cpp:1:
include/kafka/Error.h: In member function 'kafka::Error& kafka::Error::operator=(const kafka::Error&)':
include/kafka/Error.h:49:9: error: '_rkError' was not declared in this scope; did you mean 'Error'?
49 | _rkError.reset();
| ^~~~~~~~
| Error
In file included from include/kafka/ConsumerCommon.h:5,
from include/kafka/KafkaConsumer.h:5,
from KafkaConsumer.cpp:1:
include/kafka/Error.h: In member function 'int kafka::Error::value() const':
include/kafka/Error.h:83:33: error: '_rkError' was not declared in this scope; did you mean 'Error'?
83 | return static_cast<int>(_rkError ? rd_kafka_error_code(_rkError.get()) : _respErr);
| ^~~~~~~~
| Error
include/kafka/Error.h:83:44: error: 'rd_kafka_error_code' was not declared in this scope; did you mean 'rd_kafka_produce'?
83 | return static_cast<int>(_rkError ? rd_kafka_error_code(_rkError.get()) : _respErr);
| ^~~~~~~~~~~~~~~~~~~
| rd_kafka_produce
include/kafka/Error.h: In member function 'std::string kafka::Error::message() const':
include/kafka/Error.h:92:19: error: '_rkError' was not declared in this scope; did you mean 'Error'?
92 | (_rkError ? rd_kafka_error_string(_rkError.get()) : rd_kafka_err2str(_respErr));
| ^~~~~~~~
| Error
include/kafka/Error.h:92:30: error: 'rd_kafka_error_string' was not declared in this scope; did you mean 'rd_kafka_event_error_string'?
92 | (_rkError ? rd_kafka_error_string(_rkError.get()) : rd_kafka_err2str(_respErr));
| ^~~~~~~~~~~~~~~~~~~~~
| rd_kafka_event_error_string
include/kafka/Error.h: In member function 'bool kafka::Error::isFatal() const':
include/kafka/Error.h:115:17: error: '_rkError' was not declared in this scope; did you mean 'Error'?
115 | return _rkError ? rd_kafka_error_is_fatal(_rkError.get()) : _isFatal;
| ^~~~~~~~
| Error
include/kafka/Error.h:115:28: error: 'rd_kafka_error_is_fatal' was not declared in this scope; did you mean 'rd_kafka_event_error_is_fatal'?
115 | return _rkError ? rd_kafka_error_is_fatal(_rkError.get()) : _isFatal;
| ^~~~~~~~~~~~~~~~~~~~~~~
| rd_kafka_event_error_is_fatal
include/kafka/Error.h: In member function 'Optional<bool> kafka::Error::isRetriable() const':
include/kafka/Error.h:123:16: error: '_rkError' was not declared in this scope; did you mean 'Error'?
123 | return _rkError ? rd_kafka_error_is_retriable(_rkError.get()) : _isRetriable;
| ^~~~~~~~
| Error
include/kafka/Error.h:123:27: error: 'rd_kafka_error_is_retriable' was not declared in this scope
123 | return _rkError ? rd_kafka_error_is_retriable(_rkError.get()) : _isRetriable;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
include/kafka/Error.h: In member function 'bool kafka::Error::transactionRequiresAbort() const':
include/kafka/Error.h:135:16: error: '_rkError' was not declared in this scope; did you mean 'Error'?
135 | return _rkError ? rd_kafka_error_txn_requires_abort(_rkError.get()) : false;
| ^~~~~~~~
| Error
include/kafka/Error.h:135:27: error: 'rd_kafka_error_txn_requires_abort' was not declared in this scope
135 | return _rkError ? rd_kafka_error_txn_requires_abort(_rkError.get()) : false;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from include/kafka/KafkaConsumer.h:5,
from KafkaConsumer.cpp:1:
include/kafka/ConsumerCommon.h: At global scope:
include/kafka/ConsumerCommon.h:56:74: error: expected ')' before '*' token
56 | explicit ConsumerGroupMetadata(rd_kafka_consumer_group_metadata_t* p): _rkConsumerGroupMetadata(p) {}
| ~ ^
| )
include/kafka/ConsumerCommon.h:58:15: error: 'rd_kafka_consumer_group_metadata_t' does not name a type
58 | const rd_kafka_consumer_group_metadata_t* rawHandle() const { return _rkConsumerGroupMetadata.get(); }
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/kafka/ConsumerCommon.h:61:9: error: 'rd_kafka_consumer_group_metadata_unique_ptr' does not name a type; did you mean 'rd_kafka_metadata_unique_ptr'?
61 | rd_kafka_consumer_group_metadata_unique_ptr _rkConsumerGroupMetadata;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| rd_kafka_metadata_unique_ptr
In file included from include/kafka/KafkaConsumer.h:9,
from KafkaConsumer.cpp:1:
include/kafka/KafkaClient.h: In static member function 'static void kafka::clients::KafkaClient::errorCallback(rd_kafka_t*, int, const char*, void*)':
include/kafka/KafkaClient.h:523:11: error: no matching function for call to 'kafka::Error::Error()'
523 | Error error;
| ^~~~~
In file included from include/kafka/ConsumerCommon.h:5,
from include/kafka/KafkaConsumer.h:5,
from KafkaConsumer.cpp:1:
include/kafka/Error.h:42:5: note: candidate: 'kafka::Error::Error(const kafka::Error&)'
42 | Error(const Error& error) { *this = error; }
| ^~~~~
include/kafka/Error.h:42:5: note: candidate expects 1 argument, 0 provided
include/kafka/Error.h:39:5: note: candidate: 'kafka::Error::Error(rd_kafka_resp_err_t, std::string, bool)'
39 | Error(rd_kafka_resp_err_t respErr, std::string message, bool fatal = false)
| ^~~~~
include/kafka/Error.h:39:5: note: candidate expects 3 arguments, 0 provided
include/kafka/Error.h:37:14: note: candidate: 'kafka::Error::Error(rd_kafka_resp_err_t)'
37 | explicit Error(rd_kafka_resp_err_t respErr): _respErr(respErr) {}
| ^~~~~
include/kafka/Error.h:37:14: note: candidate expects 1 argument, 0 provided
In file included from KafkaConsumer.cpp:1:
include/kafka/KafkaConsumer.h: In member function 'void kafka::clients::KafkaConsumer::changeAssignment(kafka::clients::KafkaConsumer::PartitionsRebalanceEvent, const TopicPartitions&)':
include/kafka/KafkaConsumer.h:566:11: error: no matching function for call to 'kafka::Error::Error()'
566 | Error result;
| ^~~~~~
In file included from include/kafka/ConsumerCommon.h:5,
from include/kafka/KafkaConsumer.h:5,
from KafkaConsumer.cpp:1:
include/kafka/Error.h:42:5: note: candidate: 'kafka::Error::Error(const kafka::Error&)'
42 | Error(const Error& error) { *this = error; }
| ^~~~~
include/kafka/Error.h:42:5: note: candidate expects 1 argument, 0 provided
include/kafka/Error.h:39:5: note: candidate: 'kafka::Error::Error(rd_kafka_resp_err_t, std::string, bool)'
39 | Error(rd_kafka_resp_err_t respErr, std::string message, bool fatal = false)
| ^~~~~
include/kafka/Error.h:39:5: note: candidate expects 3 arguments, 0 provided
include/kafka/Error.h:37:14: note: candidate: 'kafka::Error::Error(rd_kafka_resp_err_t)'
37 | explicit Error(rd_kafka_resp_err_t respErr): _respErr(respErr) {}
| ^~~~~
include/kafka/Error.h:37:14: note: candidate expects 1 argument, 0 provided
In file included from KafkaConsumer.cpp:1:
include/kafka/KafkaConsumer.h:582:29: error: 'rd_kafka_incremental_assign' was not declared in this scope
582 | result = Error{ rd_kafka_incremental_assign(getClientHandle(), rk_tps.get()) };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
include/kafka/KafkaConsumer.h:582:90: error: no matching function for call to 'kafka::Error::Error(<brace-enclosed initializer list>)'
582 | result = Error{ rd_kafka_incremental_assign(getClientHandle(), rk_tps.get()) };
| ^
In file included from include/kafka/ConsumerCommon.h:5,
from include/kafka/KafkaConsumer.h:5,
from KafkaConsumer.cpp:1:
include/kafka/Error.h:42:5: note: candidate: 'kafka::Error::Error(const kafka::Error&)'
42 | Error(const Error& error) { *this = error; }
| ^~~~~
include/kafka/Error.h:42:5: note: conversion of argument 1 would be ill-formed:
include/kafka/Error.h:39:5: note: candidate: 'kafka::Error::Error(rd_kafka_resp_err_t, std::string, bool)'
39 | Error(rd_kafka_resp_err_t respErr, std::string message, bool fatal = false)
| ^~~~~
include/kafka/Error.h:39:5: note: candidate expects 3 arguments, 1 provided
include/kafka/Error.h:37:14: note: candidate: 'kafka::Error::Error(rd_kafka_resp_err_t)'
37 | explicit Error(rd_kafka_resp_err_t respErr): _respErr(respErr) {}
| ^~~~~
include/kafka/Error.h:37:14: note: conversion of argument 1 would be ill-formed:
In file included from KafkaConsumer.cpp:1:
include/kafka/KafkaConsumer.h:598:29: error: 'rd_kafka_incremental_unassign' was not declared in this scope
598 | result = Error{ rd_kafka_incremental_unassign(getClientHandle(), rk_tps.get()) };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/kafka/KafkaConsumer.h:598:92: error: no matching function for call to 'kafka::Error::Error(<brace-enclosed initializer list>)'
598 | result = Error{ rd_kafka_incremental_unassign(getClientHandle(), rk_tps.get()) };
| ^
In file included from include/kafka/ConsumerCommon.h:5,
from include/kafka/KafkaConsumer.h:5,
from KafkaConsumer.cpp:1:
include/kafka/Error.h:42:5: note: candidate: 'kafka::Error::Error(const kafka::Error&)'
42 | Error(const Error& error) { *this = error; }
| ^~~~~
include/kafka/Error.h:42:5: note: conversion of argument 1 would be ill-formed:
include/kafka/Error.h:39:5: note: candidate: 'kafka::Error::Error(rd_kafka_resp_err_t, std::string, bool)'
39 | Error(rd_kafka_resp_err_t respErr, std::string message, bool fatal = false)
| ^~~~~
include/kafka/Error.h:39:5: note: candidate expects 3 arguments, 1 provided
include/kafka/Error.h:37:14: note: candidate: 'kafka::Error::Error(rd_kafka_resp_err_t)'
37 | explicit Error(rd_kafka_resp_err_t respErr): _respErr(respErr) {}
| ^~~~~
include/kafka/Error.h:37:14: note: conversion of argument 1 would be ill-formed:
In file included from KafkaConsumer.cpp:1:
include/kafka/KafkaConsumer.h: In member function 'void kafka::clients::KafkaConsumer::commit(const TopicPartitionOffsets&, kafka::clients::KafkaConsumer::CommitType)':
include/kafka/KafkaConsumer.h:760:23: error: no matching function for call to 'kafka::Error::Error(<brace-enclosed initializer list>)'
760 | error = Error{};
| ^
In file included from include/kafka/ConsumerCommon.h:5,
from include/kafka/KafkaConsumer.h:5,
from KafkaConsumer.cpp:1:
include/kafka/Error.h:42:5: note: candidate: 'kafka::Error::Error(const kafka::Error&)'
42 | Error(const Error& error) { *this = error; }
| ^~~~~
include/kafka/Error.h:42:5: note: candidate expects 1 argument, 0 provided
include/kafka/Error.h:39:5: note: candidate: 'kafka::Error::Error(rd_kafka_resp_err_t, std::string, bool)'
39 | Error(rd_kafka_resp_err_t respErr, std::string message, bool fatal = false)
| ^~~~~
include/kafka/Error.h:39:5: note: candidate expects 3 arguments, 0 provided
include/kafka/Error.h:37:14: note: candidate: 'kafka::Error::Error(rd_kafka_resp_err_t)'
37 | explicit Error(rd_kafka_resp_err_t respErr): _respErr(respErr) {}
| ^~~~~
include/kafka/Error.h:37:14: note: candidate expects 1 argument, 0 provided
In file included from KafkaConsumer.cpp:1:
include/kafka/KafkaConsumer.h: In member function 'void kafka::clients::KafkaConsumer::onRebalance(rd_kafka_resp_err_t, rd_kafka_topic_partition_list_t*)':
include/kafka/KafkaConsumer.h:915:36: error: 'rd_kafka_rebalance_protocol' was not declared in this scope
915 | if (const char* protocol = rd_kafka_rebalance_protocol(getClientHandle()))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
include/kafka/KafkaConsumer.h: In member function 'kafka::clients::consumer::ConsumerGroupMetadata kafka::clients::KafkaConsumer::groupMetadata()':
include/kafka/KafkaConsumer.h:987:44: error: 'rd_kafka_consumer_group_metadata' was not declared in this scope
987 | return consumer::ConsumerGroupMetadata{rd_kafka_consumer_group_metadata(getClientHandle())};
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
from modern-cpp-kafka.
Take rd_kafka_DeleteRecords_t
for example, the interface was not available until https://github.com/edenhill/librdkafka/releases/v1.6.0
Please download the source code of a newer librdkafka
release (e.g. v1.8.2
), then configure
/make
/make install
. After that, your project should be OK to go with the modern-cpp-kafka API
.
from modern-cpp-kafka.
Related Issues (20)
- How to configure Kafka client to authenticate using `SASL_PLAINTEXT` and `SCRAM-SHA-256`? HOT 5
- is kafka:: clients:: producer:: KafkaProducer thread safe? HOT 1
- The 'auto.commit.interval.ms' property is ignored when autocommit is enabled. HOT 1
- access violation when message send to wrong partition HOT 2
- I am looking for an example with logging enabled to go to a file. HOT 1
- Aborted (core dumped)
- Cannot connect to kafka with SSL protocol HOT 1
- heartbeat expiration when topic is idle
- Issue subscribing to topic with regex HOT 2
- publishing message to multiple brokers? HOT 1
- Segv for message that cannot be sent on kafka HOT 1
- Consumer fell into an endless loop before it aborted in example_KafkaConsumer_Simple HOT 2
- poll is thread safe?
- Compatible with librdkafka 2.3 HOT 4
- Example app for oauthbearer_token_refresh_cb
- oAuth callback issue HOT 2
- inconsistent parameter of mdLifetime
- We should probably set the log-call-back got from the properties before using it.
- Kafka Headers getting clobbered for some reason HOT 1
- Does current version support oauthbearer/OIDC? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from modern-cpp-kafka.