tensaix2j / binacpp

Binance C++ library
MIT License
62 stars 133 forks source link

[Linker error] undefined reference to `lws_callback_on_writable' #5

Open myghuser7 opened 6 years ago

myghuser7 commented 6 years ago

Hello, Tried compile binacpp on windows with devc++ but I got this error ?

[Linker error] undefined reference to lws_callback_on_writable' [Linker error] undefined reference tolws_create_context' [Linker error] undefined reference to lws_canonical_hostname' [Linker error] undefined reference tolws_client_connect_via_info' [Linker error] undefined reference to lws_service' [Linker error] undefined reference tolws_context_destroy'

I added libwebsockets.a but it did not change.

Thanks.

GisTom2 commented 6 years ago

The similar error under Ubuntu:

/example$ make example

Making example

g++ -I../lib/libcurl-7.56.0/include -I../lib/jsoncpp-1.8.3/include -I../lib/libwebsockets-2.4.0/include -I../lib/libbinacpp/include \ example.cpp \ -L../lib/libcurl-7.56.0/lib \ -L../lib/libwebsockets-2.4.0/lib \ -L../lib/libbinacpp/lib \ -lcurl -ljsoncpp -lcrypto -lwebsockets -lbinacpp -o example /usr/bin/ld: warning: librtmp.so.0, needed by ../lib/libcurl-7.56.0/lib/libcurl.so, not found (try using -rpath or -rpath-link) /tmp/ccK4F6or.o: In function main': example.cpp:(.text+0x2273): undefined reference toBinaCPP::init(std::cxx11::basic_string<char, std::char_traits, std::allocator >&, std::cxx11::basic_string<char, std::char_traits, std::allocator >&)' ../lib/libcurl-7.56.0/lib/libcurl.so: undefined reference to RTMP_Write' ../lib/libcurl-7.56.0/lib/libcurl.so: undefined reference toRTMP_SetBufferMS' ../lib/libcurl-7.56.0/lib/libcurl.so: undefined reference to RTMP_Free' ../lib/libcurl-7.56.0/lib/libcurl.so: undefined reference toRTMP_Read' ../lib/libcurl-7.56.0/lib/libcurl.so: undefined reference to RTMP_Alloc' ../lib/libcurl-7.56.0/lib/libcurl.so: undefined reference toRTMP_Connect1' ../lib/libcurl-7.56.0/lib/libcurl.so: undefined reference to RTMP_Close' ../lib/libcurl-7.56.0/lib/libcurl.so: undefined reference toRTMP_ConnectStream' ../lib/libcurl-7.56.0/lib/libcurl.so: undefined reference to RTMP_SetupURL' ../lib/libcurl-7.56.0/lib/libcurl.so: undefined reference toRTMP_Init' collect2: error: ld returned 1 exit status Makefile:25: recipe for target 'example' failed make: *** [example] Error 1

mrsahabu commented 3 years ago

@Gistom2 did you solve the error?

GisTom2 commented 3 years ago

@mrsahabu I do not remember... There was several different projects last years. I am sorry.

Try this one https://stackoverflow.com/questions/41652245/error-compiling-mosquitto-1-4-8-with-libwebsockets