Skip to content

peterdocter/libcurl-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

How to Build and Use Libcurl

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.

How to Build libcurl with Visual Studio 2015 on Windows

  1. Download libcurl.

  2. Unzip the package and run Visual Studio Command Line Tool. Visual Studio 2015 command line tool

  3. Change directory to winbuild.

  4. Build static libraries with following command:

    nmake /f Makefile.vc mode=static VC=14 MACHINE=x64 DEBUG=no
    
  5. The generated libraries and header files are located at ../builds. static libcurl

  6. Create a new win32 project in Visual Studio 2015.

  7. Copy relevant libs and includes to the project.

  8. 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; } ```

References

Blog

How to Build and Use Libcurl with VS2015 on Windows

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published