4

私はHTTP/HTTPSリクエストを行うためだけにlibcurlを使用しています。ソースをダウンロードして静的ライブラリとしてビルドしました。

私の最終的な実行可能ファイルのサイズが少し大きくなりました。他の制限があるため、実行可能ファイルを削減しようとしています。

分析中に、libcurlがHTTPを含む多くのプロトコルをサポートして構築されていることを確認しました。ただし、私の特定の用途はHTTP/HTTPSです。

libcurlをビルドするときに他のプロトコルを無効にするためにコンパイルフラグを定義できる方法はありますか?

投稿を読んでいただきありがとうございます!!!

4

1 に答える 1

8

ご覧ください:http ://curl.haxx.se/docs/install.html

    Disabling Specific Protocols in Win32 builds
   --------------------------------------------

   The configure utility, unfortunately, is not available for the Windows
   environment, therefore, you cannot use the various disable-protocol
   options of the configure utility on this platform.

   However, you can use the following defines to disable specific
   protocols:

   HTTP_ONLY             disables all protocols except HTTP
   CURL_DISABLE_FTP      disables FTP
   CURL_DISABLE_LDAP     disables LDAP
   CURL_DISABLE_TELNET   disables TELNET
   CURL_DISABLE_DICT     disables DICT
   CURL_DISABLE_FILE     disables FILE
   CURL_DISABLE_TFTP     disables TFTP
   CURL_DISABLE_HTTP     disables HTTP

   If you want to set any of these defines you have the following
   possibilities:

   - Modify lib/config-win32.h
   - Modify lib/curl_setup.h
   - Modify lib/Makefile.vc6
   - Add defines to Project/Settings/C/C++/General/Preprocessor Definitions
     in the vc6libcurl.dsw/vc6libcurl.dsp Visual C++ 6 IDE project.
于 2013-03-06T15:25:48.820 に答える