socket.io-client-cpp icon indicating copy to clipboard operation
socket.io-client-cpp copied to clipboard

F this error

Open pavel1337228 opened this issue 3 years ago • 4 comments

g++ -LC:\Users\Kosmolet\vcpkg\installed\x64-windows-static\debug\lib -lsioclient -shared -o shared_lib.dll shared_lib.o -Wl,--out-implib,libshared_lib.a shared_lib.o:shared_lib.cpp:(.text+0x31): undefined reference to sio::client::~client()' shared_lib.o:shared_lib.cpp:(.text+0x68): undefined reference to sio::client::client()' collect2.exe: error: ld returned 1 exit status

pavel1337228 avatar Apr 11 '22 16:04 pavel1337228

Hi, it seems that the socket io shared DLL is not being found by the compiler

jmigual avatar Apr 13 '22 07:04 jmigual

Have you tried following the instructions to compile without CMake?

jmigual avatar Apr 13 '22 07:04 jmigual

i tried all instructions and they all failed

pavel1337228 avatar Apr 13 '22 14:04 pavel1337228

Adding this to my CMakeLists.txt solved it for me;

find_library(SIOCLIENT_LIBRARY sioclient)
target_include_directories(foo PRIVATE ${sioclient})
target_link_libraries(foo PRIVATE ${SIOCLIENT_LIBRARY})

(from here)

edde746 avatar Apr 23 '22 15:04 edde746