代码之家  ›  专栏  ›  技术社区  ›  KTC

使用Visual Studio 2010生成curl和libcurl

  •  4
  • KTC  · 技术社区  · 14 年前

    在…的帮助下 question #197444 ,我已经在Visual Studio 2010 IDE、OpenSSL 1.0.0和zlib 1.2.5中从Windows源代码构建了curl&libcurl。我现在看到的问题是,如果我用参数运行得到的curl.exe -V ,那么它报告的版本是

    curl 7.20.1 (i386-pc-win32) libcurl/7.20.1 OpenSSL/0.9.8d zlib/1.2.3
    Protocols: dict file ftp ftps http https imap imaps ldap pop3 pop3s rtsp smtp smtps telnet tftp
    Features: AsynchDNS Largefile NTLM SSL libz
    

    注意,两个openssl&zlib报告的版本不匹配,如果我实际使用的是。你知道怎么解决这个问题吗?

    p.s.是否有可以编译成libcurl的可选组件的清晰列表以及要使用的选项/预处理器指令?(例如SSPI、LIBIDN等?)

    2 回复  |  直到 14 年前
        1
  •  2
  •   Luke    14 年前

    我快速浏览了一下curl源代码,它从DLL中动态获取这些版本号,而不是从任何静态源中获取。所以这些是实际加载到curl过程中的库的版本,而不是用于构建curl源的库的版本。您的系统中可能有通过curl进程加载的那些库的旧版本。

        2
  •  1
  •   josuegomes    14 年前

    我用这个批处理文件从命令行构建curl和libcurl

    @echo off
    
    rem assumes OpenSSL at ../../openssl-1.0.0a
    rem assumes zlib at ./../zlib-1.2.5 and built with static runtime libraries (/MT)
    
    echo "Add '#define HAVE_LDAP_SSL 1' to lib\config-win32.h"
    notepad lib\config-win32.h
    pause
    
    cd lib
    nmake -f Makefile.vc9 clean
    nmake -f Makefile.vc9 OPENSSL_PATH=../../openssl-1.0.0a ZLIB_PATH=../../zlib-1.2.5    RTLIBCFG=static CFG=release-ssl-zlib
    
    cd ..
    cd src
    nmake -f Makefile.vc9 clean
    nmake -f Makefile.vc9 OPENSSL_PATH=../../openssl-1.0.0a ZLIB_PATH=../../zlib-1.2.5 RTLIBCFG=static CFG=release-ssl-zlib
    

    这就是我得到的版本

    curl 7.21.0 (i386-pc-win32) libcurl/7.21.0 OpenSSL/1.0.0a zlib/1.2.5
    Protocols: dict file ftp ftps http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smtp smtps telnet tftp
    Features: AsynchDNS Largefile NTLM SSL libz