vncoelho / optmarket-bittrex

OptMarket is a c++ framework initially designed for interacting with Bittrex crypto-currency exchange API.
Other
8 stars 1 forks source link

undefined reference to `API_PUBLIC_KEY[abi:cxx11] #1

Open vitoo opened 6 years ago

vitoo commented 6 years ago

Hello, i can't build my app with your lib (i'm new to c++)

here is the ouptut :

/tmp/ccMGnkmb.o: In function `main':
curl.cpp:(.text.startup+0xea4): undefined reference to `API_PUBLIC_KEY[abi:cxx11]'
curl.cpp:(.text.startup+0xeaf): undefined reference to `API_PUBLIC_KEY[abi:cxx11]'
curl.cpp:(.text.startup+0x130c): undefined reference to `API_PUBLIC_KEY[abi:cxx11]'
curl.cpp:(.text.startup+0x1317): undefined reference to `API_PUBLIC_KEY[abi:cxx11]'
collect2: error: ld returned 1 exit status

And flag i've used with g++ :

-lcurl -lmysqlclient -ljsoncpp -lssl -lcrypto

sample of my code :

#include <iostream>
#include <string>
#include <curl/curl.h>
#include "include/json.hpp"
#include "include/slacking.hpp"
#include "include/bittrexApi.hpp"
#include <mysql/mysql.h>

string apikey = "xx";
string apisecret = "xx";

int main(void)
{ 
// ...
 BittrexAPI bittrex;
 bittrex.setGetBalance("ETC");
}

do you have a clue ?

Thank you

vitoo commented 6 years ago

OK variable must be :

string API_PUBLIC_KEY = "x";
string API_PRIVATE_KEY = "x"; 
vitoo commented 6 years ago

Now i wonder how to get json result :)

edit :

is this the correct way to do it ?

InstuctionOptions opt;
opt.signMessage = true;
string result = bittrex.callCurlPlataform(opt);
 cout << result << "\n";