Reputation: 33
I'm little new in coding. I want to add libcurl library to my visual studio project , I think I do it right but I'm not sure . how ever I have some errors in header missing
#include <curl/curl.h>
#include <libxml/HTMLparser.h>
I add the library with References->Manage Nuget packages->and libcurl.net library
but still I have errors on compile. also I have a warning too maybe problem is in warning from
Severity Code Description Project File Line Suppression State
Warning The 'packages' element is not declared. Project3 C:\Users\Pc\Documents\Visual Studio 2015\Projects\Project3\Project3\packages.config 2
and here is my some part of the code
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <string>
#include <curl/curl.h>
#include <libxml/HTMLparser.h>
//
// Case-insensitive string comparison
//
#ifdef _MSC_VER
#define COMPARE(a, b) (!_stricmp((a), (b)))
#else
#define COMPARE(a, b) (!strcasecmp((a), (b)))
#endif
//
// libxml callback context structure
//
struct Context
{
Context() : addTitle(false) { }
bool addTitle;
std::string title;
};
//
// libcurl variables for error strings and returned data
static char errorBuffer[CURL_ERROR_SIZE];
static std::string buffer;
also I find many same topics and read them well but I don't know where is my problem.
also for an another question , my goal is get an simple string from an online page ! do you know a better and easier way to get an string??
Upvotes: 0
Views: 4554
Reputation: 817
You should provide the path to the header files of libcurl
for the compiler (prescribe it at Project->Properties->C/C++->General->Additional Include Directories
) and to the libcurl.lib (it is paired with libcurl.dll) for the linker (prescribe it at Project->Properties->Linker->Input->Additional Dependencies
).
Upvotes: 2