Как добавить библиотеку Curpp в проект C++ [дубликат]C++

Программы на C++. Форум разработчиков
Anonymous
Как добавить библиотеку Curpp в проект C++ [дубликат]

Сообщение Anonymous »

Я хочу добавить curpp в свой проект C++. В настоящее время у меня есть файл main.cpp, который выглядит следующим образом:

Код: Выделить всё

#include 
#include 
#include 
#include 

int main() {
return 0;
}
Я компилирую, используя:
"g++ -std=c++14 -I/usr/nguyenthesang/Desktop/myprogram/curlpp-0.8. 1/include main.cpp", и он успешно компилируется.

Затем я добавляю реализацию в основную функцию (ниже скопировано из репозитория curpp):

Код: Выделить всё

#include 
#include 
#include 

using namespace curlpp::options;

int main(int, char **)
{
try
{
// That's all that is needed to do cleanup of used resources (RAII
style).
curlpp::Cleanup myCleanup;

// Our request to be sent.
curlpp::Easy myRequest;

// Set the URL.
myRequest.setOpt("http://example.com");

// Send request and get a result.
// By default the result goes to standard output.
myRequest.perform();
}

catch(curlpp::RuntimeError & e)
{
std::cout 

Подробнее здесь: [url]https://stackoverflow.com/questions/43541759/how-to-add-library-curlpp-to-c-project[/url]

Вернуться в «C++»