binance-exchange / binacpp

Binance C++ library
MIT License
212 stars 108 forks source link

WebSockets library not working #6

Closed freezeware closed 6 years ago

freezeware commented 6 years ago

The provided library doesn't work with i686-posix-dwarf, MinGW-W64 version 6.1.0 or it is missing linker dependencies other than listed here. The library is impossible to build because of the unknown dependencies. Would you be kind enough to provide information and flags you used to build LibWebSockets?

src\binacpp_websocket.o: In function ZN17BinaCPP_websocket8event_cbEP3lws20lws_callback_reasonsPvS3_j': /../src/binacpp_websocket.cpp:32: undefined reference tolws_callback_on_writable' src\binacpp_websocket.o: In function ZN17BinaCPP_websocket4initEv': /../src/binacpp_websocket.cpp:89: undefined reference tolws_create_context' src\binacpp_websocket.o: In function ZN17BinaCPP_websocket16connect_endpointEPFiRN4Json5ValueEEPKc': /../src/binacpp_websocket.cpp:113: undefined reference tolws_canonical_hostname' /../src/binacpp_websocket.cpp:118: undefined reference to lws_client_connect_via_info' src\binacpp_websocket.o: In functionZN17BinaCPP_websocket16enter_event_loopEv': /../src/binacpp_websocket.cpp:133: undefined reference to lws_service' /../src/binacpp_websocket.cpp:139: undefined reference tolws_context_destroy'

tensaix2j commented 6 years ago

Did you -L../lib/libwebsockets-2.4.0/lib -lwebsockets from the src directory?

You get that error when you run make from src directory?

freezeware commented 6 years ago

Yes, this was the only one of the provided libraries that i couldn't get working. I was able to build the library without libui (and some other dependencies), but that would hinder the ability to stream the socket, even though the self-built library itself compiles. That is a problem though, because without libui (and some other dependencies?) i wont be able to use the full potential of this library.

So are there any dependencies that libwebsockets is keen on? What flags did you provide to CMake when you built it? I would like to build it myself (because it is the only way to get it working, unless you forgot to tell me something that will make it work)

freezeware commented 6 years ago

to reply to your edit; That error is generated by g++ when i'm trying to build the project from sources. Output is identical with and without -lwebsockets, however i'm positive that the library can be found and accessed

tensaix2j commented 6 years ago

Every flag that i use is in the make file of the src directory.

Here's the ldd output for libwebsockets.so.11

ldd libwebsockets.so.11 linux-vdso.so.1 => (0x00007fffe8bfe000) libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fd2ae3a8000) libssl.so.1.0.0 => /lib/x86_64-linux-gnu/libssl.so.1.0.0 (0x00007fd2ae14a000) libcrypto.so.1.0.0 => /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 (0x00007fd2add6d000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fd2ad9ae000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fd2ad7aa000) /lib64/ld-linux-x86-64.so.2 (0x00007fd2ae808000)

freezeware commented 6 years ago

sorry, i'm not sure how i could use this information - i'm on windows environment.

tensaix2j commented 6 years ago

the src and lib in my repo is for linux only. For windows you need get it from their repo.

freezeware commented 6 years ago

ah, alright. thanks i'll look into this.