0

So i'm trying to make a simple bot using the Binance API. Its currently only for me i want it to analyse the market and when some pattern is completeed it should send me a notification to a telegram channel.

My big problem is i cannot get the API working. I included all header and source files. Also added the openssl data that was not included in the Binance files.

My problem rn is in the last few lines of the binacpp.cpp i get the compile errors:

    C:\Users\llbri\Desktop\binacpp-master\src\binacpp.cpp|1803|undefined reference to `_imp__curl_global_init'|
    C:\Users\llbri\Desktop\binacpp-master\src\binacpp.cpp|1805|undefined reference to `_imp__curl_easy_init'|
    C:\Users\llbri\Desktop\binacpp-master\src\binacpp.cpp|1809|undefined reference to `_imp__curl_easy_setopt'|
    C:\Users\llbri\Desktop\binacpp-master\src\binacpp.cpp|1810|undefined reference to `_imp__curl_easy_setopt'|
    C:\Users\llbri\Desktop\binacpp-master\src\binacpp.cpp|1811|undefined reference to `_imp__curl_easy_setopt'|
    C:\Users\llbri\Desktop\binacpp-master\src\binacpp.cpp|1812|undefined reference to `_imp__curl_easy_setopt'|
    C:\Users\llbri\Desktop\binacpp-master\src\binacpp.cpp|1818|undefined reference to `_imp__curl_slist_append'|
    C:\Users\llbri\Desktop\binacpp-master\src\binacpp.cpp|1820|undefined reference to `_imp__curl_easy_setopt'|
    C:\Users\llbri\Desktop\binacpp-master\src\binacpp.cpp|1826|undefined reference to `_imp__curl_easy_setopt'|
    C:\Users\llbri\Desktop\binacpp-master\src\binacpp.cpp|1828|undefined reference to `_imp__curl_easy_setopt'|
    C:\Users\llbri\Desktop\binacpp-master\src\binacpp.cpp|1831|undefined reference to `_imp__curl_easy_perform'|
    C:\Users\llbri\Desktop\binacpp-master\src\binacpp.cpp|1838|undefined reference to `_imp__curl_easy_cleanup'|
    C:\Users\llbri\Desktop\binacpp-master\src\binacpp.cpp|1840|undefined reference to `_imp__curl_global_cleanup'|
    C:\Users\llbri\Desktop\binacpp-master\src\binacpp_utils.cpp|99|undefined reference to `EVP_sha256'|
    C:\Users\llbri\Desktop\binacpp-master\src\binacpp_utils.cpp|99|undefined reference to `HMAC'|
    obj\Debug\src\binacpp_utils.o||In function `Z6sha256B5cxx11PKc':|
    C:\Users\llbri\Desktop\binacpp-master\src\binacpp_utils.cpp|108|undefined reference to `SHA256_Init'|
    C:\Users\llbri\Desktop\binacpp-master\src\binacpp_utils.cpp|109|undefined reference to `SHA256_Update'|
    C:\Users\llbri\Desktop\binacpp-master\src\binacpp_utils.cpp|110|undefined reference to `SHA256_Final'|
    obj\Debug\src\binacpp_websocket.o||In function `ZN17BinaCPP_websocket8event_cbEP3lws20lws_callback_reasonsPvS3_j':|
    C:\Users\llbri\Desktop\binacpp-master\src\binacpp_websocket.cpp|32|undefined reference to `lws_callback_on_writable'|
    obj\Debug\src\binacpp_websocket.o||In function `ZN17BinaCPP_websocket4initEv':|
    C:\Users\llbri\Desktop\binacpp-master\src\binacpp_websocket.cpp|89|undefined reference to `lws_create_context'|
    obj\Debug\src\binacpp_websocket.o||In function `ZN17BinaCPP_websocket16connect_endpointEPFiRN4Json5ValueEEPKc':|
    C:\Users\llbri\Desktop\binacpp-master\src\binacpp_websocket.cpp|113|undefined reference to `lws_canonical_hostname'|
    C:\Users\llbri\Desktop\binacpp-master\src\binacpp_websocket.cpp|118|undefined reference to `lws_client_connect_via_info'|
    obj\Debug\src\binacpp_websocket.o||In function `ZN17BinaCPP_websocket16enter_event_loopEv':|
    C:\Users\llbri\Desktop\binacpp-master\src\binacpp_websocket.cpp|133|undefined reference to `lws_service'|
    C:\Users\llbri\Desktop\binacpp-master\src\binacpp_websocket.cpp|139|undefined reference to `lws_context_destroy'|
    ||error: ld returned 1 exit status|
    ||=== Build failed: 25 error(s), 179 warning(s) (0 minute(s), 14 second(s)) ===|

As u see i want to run the example file but i don't quite get why these errors occurr.

I am Using win64 and code::blocks IDE

I would apreciate any advice

sincerly AD

  • 1
    Take the [tour], read [MCVE]. We **definitely** need your code! – gsquaredxc Mar 03 '18 at 20:25
  • 2
    Those aren't compiler errors. Those are linker errors. If you got this far, your code compiles, but some required libraries have been left out of the build instructions. We need to see the build command line or makefile. – user4581301 Mar 03 '18 at 20:29
  • I am currently only using the example.cpp inculded by the binance api . Its more kind of a linking problem. So i can't really provide the code – Alcon Divino Mar 03 '18 at 20:29
  • 1
    Mind you, `179 warning(s)` scares the crap out of me. somewhere in that 179 warnings there are likely to be some significant logical problems you'll need to fix. – user4581301 Mar 03 '18 at 20:31
  • 1
    You didn't add the libraries you need to the project. Not much else we can say from here. – Lightness Races in Orbit Mar 03 '18 at 20:32
  • So everything i did was open the api files put everything in my IDE compile it and now i have this. The warning are all for json commands – Alcon Divino Mar 03 '18 at 20:53
  • It looks like there are multiple libraries that have to be linked with: libcurl, libwebsockets, and maybe OpenSSL (unless the sha256 functions are part of libcurl). – jcarpenter2 Mar 03 '18 at 21:49
  • I now liked everything properly. The API comes with a include and a lib file. I added the libbinacpp.so file to linker . Now i get the error _../lib/libbinacpp/li/libbinacpp/lib/libbinacpp.so: file not recognized : File format not recognized_ Any idea? – Alcon Divino Mar 14 '18 at 13:08

0 Answers0