Please enable / Bitte aktiviere JavaScript!
Veuillez activer / Por favor activa el Javascript![ ? ]
Why can't you compile the example? - bug-code.com Q&A

Why can't you compile the example?

0 like 0 dislike
50 views
As an example https://github.com/socketio/socket.io-client-cpp
Just trying to connect to the server, the server itself is available. What am I doing wrong?

#include "libs/socket.io-client-cpp/src/sio_client.h" int main(int argc, const char * argv[]) { sio::client h; h.connect("http://127.0.0.1:3000"); return 0; }


Error:
Undefined symbols for architecture x86_64:
"sio::client::connect(std::__1::basic_string, std::__1::allocator > const&)", referenced from:
_main in main.o
"sio::client::client()", referenced from:
_main in main.o
"sio::client::~client()", referenced from:
_main in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
asked by | 50 views

1 Answer

0 like 0 dislike
The library is not connected - here and swears by the linker. How to treat - put in a place where the linker searches for libraries, sootvetstvuyushie Libu (socket io) and the correct version for your architecture.

Perhaps the library is, but it is necessary to change architecture, such as x86 only enable.
answered by
Welcome to Bug-code Q&A, where you can ask questions and receive answers from other members of the community.

24.8k questions

46.2k answers

0 comments

13.3k users

24,788 questions
46,220 answers
0 comments
13,321 users