使用dynamicssl,ssh2和dynamiczlib,通过发布dynamic库在vc9 / vc11上构buildcurl

我正在试图build立与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构build工作正常,但是我也需要sftp。

为什么这个选项不存在?
有没有解决的办法?

答案是:你不能

  1. 你应该做的是用ssl,ssh2和zlib在内部使用CFG=release-ssl-ssh2-zlib建立curl。
  2. 然后使用此修补程序将dll添加到链接命令。 注意这个补丁是针对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 

您可以使用非标准的构建脚本“Makefile.vc”窗体“winbuild”文件夹。

x64动态库示例:

 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目录中,并在使用给nmake调用的选项命名的目录中建立\目录。