sednl
sednl copied to clipboard
undefined reference error
I face following error while compiling your library in linux.
/tmp/ccyANY4v.o: In function on_disconnect(SedNL::Connection&)': server.cpp:(.text+0x20): undefined reference to int SedNL::Connection::get_user_dataon_connect(SedNL::Connection&)': server.cpp:(.text+0x86): undefined reference to SedNL::Connection::set_user_data(int)'
server.cpp:(.text+0xa2): undefined reference to int SedNL::Connection::get_user_data<int>()' server.cpp:(.text+0x10c): undefined reference to SedNL::Connection::send(SedNL::Event const&)'
/tmp/ccyANY4v.o: In function on_event(SedNL::Connection&, SedNL::Event const&)': server.cpp:(.text+0x1aa): undefined reference to int SedNL::Connection::get_user_dataSedNL::operator<<(std::ostream&, SedNL::Event const&)' /tmp/ccyANY4v.o: In function main':
server.cpp:(.text+0x238): undefined reference to SedNL::SocketAddress::SocketAddress(int)' server.cpp:(.text+0x248): undefined reference to SedNL::TCPServer::TCPServer(SedNL::SocketAddress const&, bool)'
server.cpp:(.text+0x264): undefined reference to SedNL::EventListener::EventListener(SedNL::TCPServer&, unsigned int)' server.cpp:(.text+0x28e): undefined reference to SedNL::EventConsumer::EventConsumer(SedNL::EventListener&)'
server.cpp:(.text+0x2cc): undefined reference to SedNL::EventListener::run()' server.cpp:(.text+0x2d6): undefined reference to SedNL::EventConsumer::run()'
server.cpp:(.text+0x31e): undefined reference to SedNL::EventConsumer::~EventConsumer()' server.cpp:(.text+0x32e): undefined reference to SedNL::EventListener::~EventListener()'
server.cpp:(.text+0x33e): undefined reference to SedNL::TCPServer::~TCPServer()' /tmp/ccyANY4v.o: In function SedNL::Packet SedNL::make_packet<char const*>(char const*)':
server.cpp:(.text.ZN5SedNL11make_packetIJPKcEEENS_6PacketEDpT[ZN5SedNL11make_packetIJPKcEEENS_6PacketEDpT]+0x18): undefined reference to SedNL::Packet::Packet()' /tmp/ccyANY4v.o: In function void SedNL::write_to_packet<char const*>(SedNL::Packet&, char const*)':
server.cpp:(.text.ZN5SedNL15write_to_packetIPKcJEEEvRNS_6PacketET_DpT0[ZN5SedNL15write_to_packetIPKcJEEEvRNS_6PacketET_DpT0]+0xe): undefined reference to `SedNL::Packet& SedNL::Packet::operator<< <char const*>(char const*)'
collect2: error: ld returned 1 exit status
I just tried to compile it right now on an ubuntu VM, and didn't get any error. But I noticed that the README.md was unclear.
Did you created a build directory in the sednl repo, then enter this directory via cd build before typing cmake ..?