Libcurl is a free, open source library for transferring data. It supports various protocols include FTP, FTPS, HTTP, HTTPS, GOPHER, TFTP, SCP, SFTP, TELNET, DICT, LDAP, LDAPS, FILE, IMAP, SMTP, POP3, RTSP and RTMP.
-
Download libcurl.
-
Change directory to winbuild.
-
Build static libraries with following command:
nmake /f Makefile.vc mode=static VC=14 MACHINE=x64 DEBUG=no
-
The generated libraries and header files are located at ../builds.
-
Create a new win32 project in Visual Studio 2015.
-
Copy relevant libs and includes to the project.
-
Write a simple test.
#include "stdafx.h" #include "libcurl/include/curl/curl.h" #ifdef _DEBUG
#pragma comment(lib, "libcurl/lib/libcurl_a_debug.lib") #else #pragma comment(lib, "libcurl/lib/libcurl_a.lib") #endif int main() { curl_global_init(CURL_GLOBAL_DEFAULT); CURL *curl = curl_easy_init(); if (curl) { CURLcode res; curl_easy_setopt(curl, CURLOPT_URL, "http://www.dynamsoft.com"); res = curl_easy_perform(curl); curl_easy_cleanup(curl); } curl_global_cleanup(); return 0; } ```