使用动态ssl,ssh2和动态zlib发布动态库,在vc9 / vc11上构建Curl

时间:2013-08-19 13:39:33

标签: windows visual-studio-2012 curl visual-studio-2008 compilation


我正在尝试使用zlib,ssh2和openssl支持构建curl dll库

但是,当我指定release-dll-ssl-dll-ssh2-dll-zlib-dll

我得到这个清单:

Usage: nmake /f makefile.vc9 CFG=<config> <target>
where <config> is one of:
release                      - release static library
release-ssl                  - release static library with ssl
release-zlib                 - release static library with zlib
release-ssl-zlib             - release static library with ssl and zlib
release-ssl-ssh2-zlib        - release static library with ssl, ssh2 and zlib
release-ssl-dll              - release static library with dynamic ssl
release-zlib-dll             - release static library with dynamic zlib
release-ssl-dll-zlib-dll     - release static library with dynamic ssl and dynamic zlib
release-dll                  - release dynamic library
release-dll-ssl-dll          - release dynamic library with dynamic ssl
release-dll-zlib-dll         - release dynamic library with dynamic zlib
release-dll-ssl-dll-zlib-dll - release dynamic library with dynamic ssl and dynamic zlib
debug                        - debug static library
debug-ssl                    - debug static library with ssl
debug-zlib                   - debug static library with zlib
debug-ssl-zlib               - debug static library with ssl and zlib
debug-ssl-ssh2-zlib          - debug static library with ssl, ssh2 and zlib
debug-ssl-dll                - debug static library with dynamic ssl
debug-zlib-dll               - debug static library with dynamic zlib
debug-ssl-dll-zlib-dll       - debug static library with dynamic ssl and dynamic zlib
debug-dll                    - debug dynamic library
debug-dll-ssl-dll            - debug dynamic library with dynamic ssl
debug-dll-zlib-dll           - debug dynamic library with dynamic zlib1
debug-dll-ssl-dll-zlib-dll   - debug dynamic library with dynamic ssl and dynamic zlib
<target> can be left blank in which case all is assumed
Makefile.vc9(476) : fatal error U1050: please choose a valid configuration "release-dll-ssl-dll-zlib-dll-ssh2-dll"

使用release-ssl-dll-zlib-dll构建工作正常,但我还需要sftp。

为什么这个选项不存在?
有办法解决这个问题吗?

2 个答案:

答案 0 :(得分:1)

答案是:你不能

  1. 你应该做的是使用CFG=release-ssl-ssh2-zlib在内部使用ssl,ssh2和zlib构建curl。
  2. 然后使用this patch将dll添加到link命令。请注意,此修补程序适用于VC10,但可以在vc9 makefile上轻松完成。
  3. 在构建之后,如果要构建针对它的东西(比如PHP),则需要将libssh2.lib添加到lincurl.lib中。这可以使用此命令完成(设置libssh2.lib和libcurl.lib的路径):

    lib.exe /OUT:libcurl_merged.lib libssh2.lib libcurl.lib
    copy libcurl_merged.lib libcurl.lib
    

答案 1 :(得分:0)

您可以使用非标准构建脚本&#34; Makefile.vc&#34;形式&#34; winbuild&#34;文件夹中。

x64 dynamics lib的示例:

cd curl-src\winbuild
nmake /f Makefile.vc mode=dll VC=14 MACHINE=x64 DEBUG=no GEN_PDB=yes  WITH_SSL=dll WITH_ZLIB=dll WITH_SSH2=dll

构建将位于顶部curl-src目录,builds \目录中 使用为nmake调用提供的选项命名的目录。