Mac OS Sierra Apple LLVM version 8.0.0 (clang-800.0.42.1) gcc version c++-9 (Homebrew GCC 9.2.0_2) 9.2.0
I am trying to compile a test program that uses https://github.com/binance-exchange/binacpp which uses microsoft's jsoncpp https://github.com/open-source-parsers/jsoncpp and the openssl, curl, websockets, json libraries i am running into a linking problem and it seems to me that none of the symbols are resolved. cant figure out why. Might be due to the ugly setup...
ugly setup: - microsoft (jsoncpp) uses some tech that is not supported by llvm/clang so it suggests using gcc and microsoft's packetmanager vcpkg. with gcc the source compiled into a static library libjsoncpp.a which i copied into my testprogramm's dir. - compiled binacpp sources with gcc -c into objectfiles and used ar rcs libbinacpp *.o to create another static library - included include and lib dirs for openssl that is for some reason not found in the usual dirs, als well as the header files for libjsoncpp directly
whole command:
/usr/local/opt/gcc/bin/c++-9 test.cpp libbinacpp.a libjsoncpp.a
-I/Users/N/Downloads/vcpkg/packages/jsoncpp_x64-osx/include
-I/usr/local/Cellar/openssl@1.1/1.1.1d/include
-L/usr/local/Cellar /openssl@1.1/1.1.1d/lib -lwebsockets -ljson -lcurl -lssl
the whole thing gives me lots of errors. Have no idea whats going wrong... Any help appreciated.
Regards.
errors (small portion):
Undefined symbols for architecture x86_64: -"_EVP_sha256", referenced from: - hmac_sha256[abi:cxx11](char const*, char const*) in libbinacpp.a(binacpp_utils.o) - "_HMAC", referenced from: - hmac_sha256[abi:cxx11](char const*, char const*) in libbinacpp.a(binacpp_utils.o) - "_SHA256_Final", referenced from: - sha256[abi:cxx11](char const*) in libbinacpp.a(binacpp_utils.o) - "_SHA256_Init", referenced from: - sha256[abi:cxx11](char const*) in libbinacpp.a(binacpp_utils.o) - "_SHA256_Update", referenced from: - sha256[abi:cxx11](char const*) in libbinacpp.a(binacpp_utils.o) - "Json::Reader::parse(std::__cxx11::basic_string, -std::allocator > const&, Json::Value&, bool)", referenced from: - BinaCPP::get_exchangeInfo(Json::Value&) in libbinacpp.a(binacpp.o) - BinaCPP::get_serverTime(Json::Value&) in libbinacpp.a(binacpp.o) - BinaCPP::get_allPrices(Json::Value&) in libbinacpp.a(binacpp.o) - BinaCPP::get_allBookTickers(Json::Value&) in libbinacpp.a(binacpp.o) - BinaCPP::get_depth(char const*, int, Json::Value&) in libbinacpp.a(binacpp.o) - BinaCPP::get_aggTrades(char const*, int, long, long, int, Json::Value&) in -libbinacpp.a(binacpp.o) - BinaCPP::get_24hr(char const*, Json::Value&) in libbinacpp.a(binacpp.o) - ... - "Json::operator<<(std::basic_ostream >&, Json::Value const&)", -referenced from: - _main in ccsPSRMm.o - "Json::Value::asStringabi:cxx11 const", referenced from: - BinaCPP::get_price(char const*) in libbinacpp.a(binacpp.o) - BinaCPP::get_bookTicker(char const*, Json::Value&) in libbinacpp.a(binacpp.o) - "std::__1::basic_string, std::__1::allocator
... a lot more errors ....
ld: symbol(s) not found for architecture x86_64 collect2: error: ld returned 1 exit status