Not able to successfully compile. Undefined references to cpr

This commit is contained in:
amazing-username
2019-03-20 00:08:47 -04:00
parent 9dcf70b157
commit 1ebc61389b
7 changed files with 40 additions and 4 deletions
+3 -2
View File
@@ -35,11 +35,12 @@ int main(int argc, char** argv)
}
cout<<"Song path: "<<songPath<<endl;
FileManager fm{songPath};
fm.saveFile(newSongPath);
Upload upS{songPath};
upS.uploadSong();
FileManager fm{songPath};
fm.saveFile(newSongPath);
return 0;
+3
View File
@@ -0,0 +1,3 @@
#include"Download.h"
Download::Download() { }
+16
View File
@@ -0,0 +1,16 @@
#ifndef DOWNLOAD_H_
#define DOWNLOAD_H_
#include<iostream>
namespace Syncers
{
class Download
{
public:
Download();
private:
}
}
#endif
+12 -1
View File
@@ -1,6 +1,7 @@
#include<iostream>
#include<string>
#include<cpr/cpr.h>
#include<nlohmann/json.hpp>
#include"Upload.h"
@@ -11,12 +12,15 @@ using std::string;
using json = nlohmann::json;
using namespace cpr;
namespace Syncers
{
Upload::Upload() { }
Upload::Upload(string filePath)
{
this->fMgr = Managers::FileManager{filePath};
this->songPath = filePath;
this->fMgr = Managers::FileManager(songPath);
}
@@ -26,6 +30,13 @@ namespace Syncers
json jObj = serializeObject();
printJsonData(jObj);
std::string url = apiUrl + apiEndPoint;
auto r = cpr::Post(cpr::Url{url},
cpr::Multipart{{"key", "file"},
{"value", cpr::File{songPath}}});
cout << r.text << std::endl;
}
void Upload::configureSong()
+2 -1
View File
@@ -23,7 +23,8 @@ namespace Syncers
Managers::FileManager fMgr;
Models::Song song;
std::string apiUrl{"http://192.168.1.24"};
std::string apiEndPoint{"/api/song"};
std::string apiEndPoint{"/api/song/data"};
std::string songPath;
int port{9349};
void configureSong();