Getting linker error while compiling example3.cpp file

Jitu1990
Dear friends, I am getting below linker error while compilation of example3.cpp file. I have installed websocket v0.14 and other dependencies too. Even I checked the refearances of method the linker is seeking. Can someone please help me here if already faced this issue. Below is the snap of errors I am getting.

/usr/bin/ld: /tmp/ccH4I72s.o: in function `uWS::Hub::Hub(int, bool, unsigned int)':
/usr/local/include/uWS/Hub.h:50: undefined reference to `uS::Node::Node(int, int, int, bool)'
/usr/bin/ld: /usr/local/include/uWS/Hub.h:50: undefined reference to `uWS::Group::Group(int, unsigned int, uWS::Hub*, uS::NodeData*)'
/usr/bin/ld: /usr/local/include/uWS/Hub.h:50: undefined reference to `uWS::Group::Group(int, unsigned int, uWS::Hub*, uS::NodeData*)'
/usr/bin/ld: /usr/local/include/uWS/Hub.h:54: undefined reference to `uWS::Hub::allocateDefaultCompressor(z_stream_s*)'
/usr/bin/ld: /usr/local/include/uWS/Hub.h:67: undefined reference to `uS::Node::~Node()'
/usr/bin/ld: /tmp/ccH4I72s.o: in function `uWS::Hub::~Hub()':
/usr/local/include/uWS/Hub.h:73: undefined reference to `uS::Node::~Node()'
/usr/bin/ld: /tmp/ccH4I72s.o: in function `kiteconnect::ticker::run()':
/home/jitendra/Desktop/TEMP_DIR/cppkiteconnect/include/kitepp/ticker/internal.hpp:93: undefined reference to `uS::Node::run()'
/usr/bin/ld: /tmp/ccH4I72s.o: in function `kiteconnect::ticker::stop()':
/home/jitendra/Desktop/TEMP_DIR/cppkiteconnect/include/kitepp/ticker/internal.hpp:96: undefined reference to `uWS::WebSocket::close(int, char const*, unsigned long)'
/usr/bin/ld: /tmp/ccH4I72s.o: in function `kiteconnect::ticker::setMode(std::__cxx11::basic_string, std::allocator > const&, std::vector > const&)':
/home/jitendra/Desktop/TEMP_DIR/cppkiteconnect/include/kitepp/ticker/internal.hpp:154: undefined reference to `uWS::WebSocket::send(char const*, unsigned long, uWS::OpCode, void (*)(uWS::WebSocket*, void*, bool, void*), void*, bool, unsigned long*)'
/usr/bin/ld: /tmp/ccH4I72s.o: in function `kiteconnect::ticker::connectInternal()':
/home/jitendra/Desktop/TEMP_DIR/cppkiteconnect/include/kitepp/ticker/internal.hpp:170: undefined reference to `uWS::Hub::connect(std::__cxx11::basic_string, std::allocator >, void*, std::map, std::allocator >, std::__cxx11::basic_string, std::allocator >, std::less, std::allocator > >, std::allocator, std::allocator > const, std::__cxx11::basic_string, std::allocator > > > >, int, uWS::Group*)'
/usr/bin/ld: /tmp/ccH4I72s.o: in function `kiteconnect::ticker::assignCallbacks()::{lambda(void*)#4}::operator()(void*) const':
/home/jitendra/Desktop/TEMP_DIR/cppkiteconnect/include/kitepp/ticker/internal.hpp:412: undefined reference to `uWS::WebSocket::close(int, char const*, unsigned long)'
/usr/bin/ld: /tmp/ccH4I72s.o: in function `kiteconnect::ticker::assignCallbacks()':
/home/jitendra/Desktop/TEMP_DIR/cppkiteconnect/include/kitepp/ticker/internal.hpp:374: undefined reference to `uWS::Group::onConnection(std::function*, uWS::HttpRequest)>)'
/usr/bin/ld: /home/jitendra/Desktop/TEMP_DIR/cppkiteconnect/include/kitepp/ticker/internal.hpp:389: undefined reference to `uWS::Group::onMessage(std::function*, char*, unsigned long, uWS::OpCode)>)'
/usr/bin/ld: /home/jitendra/Desktop/TEMP_DIR/cppkiteconnect/include/kitepp/ticker/internal.hpp:404: undefined reference to `uWS::Group::onPong(std::function*, char*, unsigned long)>)'
/usr/bin/ld: /home/jitendra/Desktop/TEMP_DIR/cppkiteconnect/include/kitepp/ticker/internal.hpp:409: undefined reference to `uWS::Group::onError(std::function)'
/usr/bin/ld: /home/jitendra/Desktop/TEMP_DIR/cppkiteconnect/include/kitepp/ticker/internal.hpp:417: undefined reference to `uWS::Group::onDisconnection(std::function*, int, char*, unsigned long)>)'
/usr/bin/ld: /home/jitendra/Desktop/TEMP_DIR/cppkiteconnect/include/kitepp/ticker/internal.hpp:430: undefined reference to `uWS::Group::startAutoPing(int, std::__cxx11::basic_string, std::allocator >)'
/usr/bin/ld: /tmp/ccH4I72s.o: in function `uWS::Group* uWS::Hub::createGroup(int, unsigned int)':
/usr/local/include/uWS/Hub.h:36: undefined reference to `uWS::Group::Group(int, unsigned int, uWS::Hub*, uS::NodeData*)'
collect2: error: ld returned 1 exit status
Tagged:
  • rakeshr
    undefined reference to `uS::Node::run()'
    undefined reference to `uWS::WebSocket::close(int, char const*, unsigned long)'
    These errors occurs, if your code is not complied properly or if compiled with different C++ standards.
Sign In or Register to comment.