添加卷曲库C
Add curl library C++
本文关键字:添加 更新时间:2023-10-16
我在编码方面并不新鲜。我想将libcurl库添加到我的Visual Studio项目中,我想我做对了,但我不确定。我遇到的任何错误都缺少
#include <curl/curl.h>
#include <libxml/HTMLparser.h>
我添加了带有参考的库 ->管理nuget packages->和libcurl.net库
但我仍然有编译错误。我也有警告,也许问题是从
警告Severity Code Description Project File Line Suppression State
Warning The 'packages' element is not declared. Project3 C:UsersPcDocumentsVisual Studio 2015ProjectsProject3Project3packages.config 2
这是我的某个代码的一部分
#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;
我也发现了许多相同的主题,并且阅读良好,但我不知道我的问题在哪里。
也是一个问题,我的目标是从在线页面上获取一个简单的字符串!您知道获取字符串的更好,更简单的方法吗?
您应该为编译器的libcurl
标头文件提供路径(在Project->Properties->C/C++->General->Additional Include Directories
处开处方(和libcurl.lib(与libcurl.dll配对(linker(libcurl.dll(在Project->Properties->Linker->Input->Additional Dependencies
处开处方(。
相关文章:
- 将成员变量添加到共享库中的类中,不会破坏二进制兼容性吗
- 如何在C++中从两个单独的for循环中添加两个数组
- POCO::PostgreSQL:如何将std::vector支持添加到`Binder::bind`
- 如何仅为一个函数添加延迟
- 如何防止 c++ 在从浮点型转换为双精度型(不适用于 IO)时添加额外的小数?
- 使用std::transform将一个范围的元素添加到另一个范围中
- 如何将更多文件夹添加到c++include路径
- 如何将元素添加到数组的线程安全函数?
- QT通过C++添加映射QML项目
- 如何将点击的信号和插槽添加到qt中的自定义按钮中
- 如何使用重载的相等(==)运算符向测试用例添加描述
- 为什么Mat类的两个对象可以在不重载运算符+的情况下添加
- 如何防止clang格式在流运算符调用之间添加换行符<<
- 只能向C++添加一定数量的字符
- Qt和C++:将QLineEdit添加到QTabWidget中
- 将QIcon添加到QTableView单元格
- 为什么我必须在C++中添加一个赋值符号来声明一个数组
- 为什么除非添加括号,否则构造函数上的模板替换会失败?
- 将图像添加到资源文件夹UWP C++
- 当我尝试添加 2 个大字符串时,我无法弄清楚出了什么问题