[Libcurl]Build&Use Manual
来源:互联网 发布:蔡琴与杨德昌知乎 编辑:程序博客网 时间:2024/06/15 23:02
Version
- Visual Studio 2013
- curl-7.53.1.zip(download)
Build libcurl static library
1 Extract curl-7.53.1.zip to a local directory(c:\libcurl)
2 Open VS2013 x86 Native Tools Command Prompt
3 cd c:\libcurl\winbuild
4 Compile
/MDnmake /f Makefile.vc mode=static VC=12/MTnmake /f Makefile.vc mode=static VC=12 RTLIBCFG=static
Static linking of Microsoft’s C RunTime (CRT)
If you are using mode=static nmake will create and link to the static build of
libcurl but not the static CRT. If you must you can force nmake to link in
the static CRT by passing RTLIBCFG=static. Typically you shouldn’t use that
option, and nmake will default to the DLL CRT. RTLIBCFG is rarely used and
therefore rarely tested. When passing RTLIBCFG for a configuration that was
already built but not with that option, or if the option was specified
differently, you must destroy the build directory containing the configuration
so that nmake can build it from scratch.
5 Build result in C:\libcurl\builds\libcurl-vc12-x86-release-static-ipv6-sspi-winssl
Link Against libcurl in Visual Studio
1 cd C:\libcurl\builds\libcurl-vc12-x86-release-static-ipv6-sspi-winssl
2 copy include&lib directories to your solutions directory
3 Configuration Properties > C/C++ > General > Additional Include Directories: add * $(SolutionDir)\include\ *
4 Configuration Properties > C/C++ > Preprocessor > Preprocessor Definitions: add CURL_STATICLIB
5 Configuration Properties > Linker > General > Additional Library Directories: add * $(SolutionDir)\lib\ *
6 Configuration Properties > Linker > Input > Additional Dependencies: add libcurl_a.lib
Test libcurl in Your Project
#include <stdio.h>#include <curl/curl.h>int main(int argc, char* argv[]){ CURL *curl = curl_easy_init(); if (curl) printf("curl_easy_init() succeeded!\n"); else fprintf(stderr, "Error calling curl_easy_init().\n"); return 0;}
Refer
- https://stackoverflow.com/questions/20171165/getting-libcurl-to-work-with-visual-studio-2013
- https://curl.haxx.se/mail/lib-2014-06/0235.html
- http://blog.csdn.net/ixiaochouyu/article/details/47998267
- %libcurl%\winbuild\BUILD.WINDOWS.txt
- [Libcurl]Build&Use Manual
- AndroidTVWidget use manual
- How to use libcurl
- Use META to build Security
- Use GRUB2 to Boot Linux(from grub manual)
- How to use libcurl in C++ with std::string
- manual
- libcurl
- libcurl
- libcurl
- libcurl
- libcurl
- libcurl
- libcurl
- libcurl
- libcurl
- libcurl
- libcurl
- java web项目创建读取资源文件的Messages类
- 【初识python】用xlrd,xlwt,xlutils操作excel学习笔记
- JavaScript 动画之缓冲运动
- flex布局
- 一条SQL查询单个数据和多个数据,并能在分页上显示
- [Libcurl]Build&Use Manual
- android热更新之Bugly
- jq插件的机制,$.extend()和$.fn.extend()的区别及闭包的相关简单案例
- 笔记4,mybatis遇到的新的知识
- ASP.NET 路由设置 学习笔记
- 0 有趣的机器学习
- leetcode_160. Intersection of Two Linked Lists ? 待解决
- 云星数据---Scala实战系列(精品版)】:Scala入门教程016-Scala实战源码-Scala 判断语句 、循环与java的比较
- C++ 如何突破private成员的访问限制