using libcurl without dll

前端 未结 2 1279
南方客
南方客 2020-12-01 16:58

I am using Microsoft Visual C++ 2010, and I need to make an application that does not require the libcurl dll. I am defining CURL_STATICLIB in the preprocessor directives an

2条回答
  •  攒了一身酷
    2020-12-01 17:31

    I got a static build of libcurl to compile and link by specifying both HTTP_ONLY and CURL_STATICLIB in the preprocessor directives of the libcurl project and my application. This eliminates all the dependencies required by protocols you likely do not need. The application now works without requiring any DLLs at all.

    Beside the above, I just needed to make sure libcurl.lib and the path to the curl include files were set in the application's visual studio project settings.

    References I used:

    Disabling Specific Protocols in Win32 builds: http://curl.haxx.se/mail/lib-2011-12/0123.html

    Using libcurl in Visual Studio (out-dated): http://curl.haxx.se/libcurl/c/visual_studio.pdf

提交回复
热议问题