Closed rayguang closed 5 years ago
Issues resolved.
recompiled the binacepp from /src.
However, I added the following function back to binance_utils.h to resolve the to_string was not declared in this scope error)
Added the following to binance_utils.h
template
static std::string to_string(double val) { std::ostringstream out; out.precision(8); out.setf(std::ios_base::fixed); out << val; return out.str(); }
hello,
I got some link errors. I put all binance related .h and .cpp files in the same directory as example.cpp (to resolve some errors related to to_string was not declared in this scope)
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 -lcrypto -lwebsockets -lbinacpp -o example /tmp/ccSoRo3V.o: In function
BinaCPP::get_price(char const*)': example.cpp:(.text+0x64d): undefined reference to
string_toupper[abi:cxx11](char const)' /tmp/ccSoRo3V.o: In function `BinaCPP::get_bookTicker(char const, Json::Value&)': example.cpp:(.text+0xa9a): undefined reference tostring_toupper[abi:cxx11](char const*)' /tmp/ccSoRo3V.o: In function
BinaCPP::get_account(long, Json::Value&)': example.cpp:(.text+0x1e93): undefined reference tohmac_sha256[abi:cxx11](char const*, char const*)' /tmp/ccSoRo3V.o: In function
BinaCPP::get_myTrades(char const, int, long, long, Json::Value&)': example.cpp:(.text+0x25c9): undefined reference to `hmac_sha256[abi:cxx11](char const, char const)' /tmp/ccSoRo3V.o: In function `BinaCPP::get_openOrders(char const, long, Json::Value&)': example.cpp:(.text+0x2c98): undefined reference tohmac_sha256[abi:cxx11](char const*, char const*)' /tmp/ccSoRo3V.o: In function
BinaCPP::get_allOrders(char const, long, int, long, Json::Value&)': example.cpp:(.text+0x3407): undefined reference to `hmac_sha256[abi:cxx11](char const, char const)' /tmp/ccSoRo3V.o: In function `BinaCPP::send_order(char const, char const, char const, char const, double, double, char const, double, double, long, Json::Value&)': example.cpp:(.text+0x3db9): undefined reference tohmac_sha256[abi:cxx11](char const*, char const*)' /tmp/ccSoRo3V.o:example.cpp:(.text+0x44e9): more undefined references to
hmac_sha256[abi:cxx11](char const, char const)' follow collect2: error: ld returned 1 exit status Makefile:21: recipe for target 'example' failed make: *** [example] Error 1Any hint is welcome. thanks much!