-
Notifications
You must be signed in to change notification settings - Fork 419
Open
Description
#include <lcm/lcm-cpp.hpp>
void onMessage(const [lcm::ReceiveBuffer](https://lcm-proj.github.io/lcm/doxygen_output/c_cpp/html/structlcm_1_1ReceiveBuffer.html)* rbuf, const std::string& channel, void*) {
// do something with the message. Raw message bytes are
// accessible via rbuf->data
}
int main(int argc, char** argv) {
LCM::lcm lcm;
lcm.subscribe("CHANNEL", onMessage, NULL);
while(true)
lcm.handle();
return 0;
}Replace the contents of examples/cpp/listener.cpp with the above and you get
lcm/examples/cpp/listener.cpp:9:3: error: ‘LCM’ has not been declared
9 | LCM::lcm lcm;
Fix it to lcm::LCM lcm and then you get:
lcm/examples/cpp/listener.cpp:10:16: error: no matching function for call to ‘lcm::LCM::subscribe(const char [8], void (&)(const lcm::ReceiveBuffer*, const string&, void*), NULL)’
10 | lcm.subscribe("CHANNEL", onMessage, NULL);
I suspect there's more where this is found.
Metadata
Metadata
Assignees
Labels
No labels