libCurl的C++引用
I believe I have gotten LibCurl to work with Visual Studio 2013 now. Persistence ftw! Although, after spending hours trying to solve these error messages, I am a little hesitant at saying everything is working fine now. That is why I am putting a bounty on this question to get clear and conciseinstructions on getting LibCurl to work with Visual Studio 2013.
This is what I did to get it to work:
First, download the Win32 MSVC package here: http://curl.haxx.se/download.html#Win32 For these instructions sake, let's say you downloaded to C:\LibCurl
Start a new project in Visual Studio. Go to Project|Project Properties|VC++ Directories|Include Directories| Add the path to the include directory inside the downloaded package. (C:\LibCurl\include)
Next, go to Project|Project Properties|Linker|General|Additional Library Directories| Add the path to the lib directory. (Where curllib.dll is located)
Then, go to Project|Project Properties|Linker|Input|Additional Dependencies| And add curllib.lib
Now if you compile a test program, you will likely get the message saying libsasl.dll is missing. You will need to download this file and put it in the same directory as your build. I used 7-Zip to extract libsasl.dll from OpenLDAP for Windows. OpenLDAP for Windows
This is the result of my test code from above:
------------配置好后,将dl放置到对应的目录下--------------------
示范代码
#include <iostream>
#include <stdio.h>
#include <curl/curl.h>
int main(void)
{
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if (curl) {
curl_easy_setopt(curl, CURLOPT_URL, "http://www.baidu.com");
res = curl_easy_perform(curl);
/* always cleanup */
curl_easy_cleanup(curl);
}
return 0;
}
libCurl的C++引用的更多相关文章
- windows 下编译libcurl
因为linux平台采用了libcurl,有一个程序移植到到windows平台,再linux采用libcurl.在windows下准备也采用该库.在网上搜索了几位同行写的,步骤上面有缺失. 本文将以详细 ...
- 开源免费的C/C++网络库(c/c++ sockets library)补充
(1)ACE 庞大.复杂,适合大型项目.开源.免费,不依赖第三方库,支持跨平台. http://www.cs.wustl.edu/~schmidt/ACE.html (2)Asio Asio基于Boo ...
- libcurl 函数curl_easy_perform在release下崩溃的问题
今天遇到一个很奇怪的问题: 工程中用到了libcurl, debug可以正常运行,release每次都崩溃,断到curl_easy_perform这一行.堆栈中也得不到有用信息,于是GOOGLE一番, ...
- 解决 WinXP下 libcurl.dll 无法定位程序输入点GetTickCount64问题
1. 问题描述 用 IDA 打开libcurl.dll 可以在导入表看到对 GetTickCount64的引用,在 xp 的kernel32.dll中没有 GetTickCount64, 所以会出现 ...
- Yocto开发笔记之《嵌入式linux libcurl编程》(QQ交流群:519230208)
开了一个交流群,欢迎爱好者和开发者一起交流,转载请注明出处. QQ群:519230208,为避免广告骚扰,申请时请注明 “开发者” 字样 =============================== ...
- libcurl安装使用方法-简单实用(摘录)
http://curl.haxx.se/libcurl/c/example.html 官网c例子http://curl.haxx.se/download/curl-7.21.3.tar.gz 下载地址 ...
- [工作积累] android 中添加libssl和libcurl
1. libssl https://github.com/guardianproject/openssl-android 然后执行ndk-build 2.libcurl 源代码组织结构, 下面的mak ...
- Libcurl安装及编译
1.安装curl wget http://curl.haxx.se/download/curl-7.26.0.tar.gz tar -zxvf curl-7.26.0.tar.gz cd curl- ...
- libcurl返回常见错误码
转载:https://blog.csdn.net/kenkao/article/details/46875571 转载:http://www.cnblogs.com/wainiwann/p/34929 ...
随机推荐
- C#中DataTable行转列示例
将下面表(1)格式的数据转换为表(2)格式的数据.很明显,这是一个行转列的要求,本想在数据库中行转列,因为在数据库中行转列是比较简单的,方法可以参考本站SQLServer中(行列转换)行转列及列转行且 ...
- 解决hyerv的linux虚拟机网卡地址重启发生变化的问题
关于linux的虚拟机,当进行虚拟机copy的时候,由于虚拟机配置文件里面会记录网卡的mac地址,所以导致linux里面记录的网卡地址和实际的会有冲突,这样linux会自动把网卡地址提高. 比如原来是 ...
- 使用javascript判断浏览器类型
之前在项目中遇到过要针对不同浏览器做不同的一些js或者css操作,后来某个朋友也突然问到这个问题,所以,整理了一下,在这里留个笔记,方便以后使用. 使用javascript判断浏览器类型: funct ...
- oracle REGEXP_SUBSTR实现字符串转列
如将字符串'张三,李四,王五,赵六,'转换成 1. 张三 2.李四 3.王五 4.赵六 REGEXP_SUBSTR 查询语句: WITH TEST AS (SELECT '张三,李四,王五,赵六, ...
- vector容器经常用法
容器简单介绍 定义及初始化 末尾插入元素 遍历 size 函数是能够动态添加的 通过下标操作添加改变vector内容不是安全的操作 仅能对已存在元素进行下标操作不存在会crash 将元素一个容器复制给 ...
- ubuntu下mysql中文乱码问题
本来就是想弄个网页往数据库里添加数据的,然后就发现了mysql的中文乱码问题,弄了半天解决方法如下: 首先停mysql服务,编辑配置文件my.cnf $ sudo stop mysql $sudo v ...
- apktool的下载地址
googlecode将要关闭,代码转移到以下网址 http://ibotpeaches.github.io/Apktool/
- Java基础知识强化31:String类之String的面试题
1.先看一个图: 2.String面试题: (1)题1: package cn.itcast_02; /* * 看程序写结果 */ public class StringDemo3 { public ...
- SparseArray HashMap 稀疏数组 二分法
简介 HashMap是java里比较常用的一个集合类,我们常用其来缓存一些处理后的结果,但是在Android项目中,Eclipse却给出了一个 performance 警告.意思就是说用SparseA ...
- DIV布局之道二:DIV块的嵌套,DIV盒子模型
本文讲解DIV块布局的第二种使用方式:嵌套.“DIV嵌套”在有些文献中也被称为“盒子模型”,说的通俗一点就是嵌套(一个大的DIV块内部又包含一个或多个DIV块). 请看如下代码: CSS部分: CSS ...