简体   繁体   English

使用 Zlib 构建 Libcurl 时出现错误

[英]I get an error when building Libcurl with Zlib

I'm trying to build a static library - libcurl + zlib, but I get an error:(我正在尝试构建一个 static 库 - libcurl + zlib,但出现错误:(

-I built static-debug Zlib and as stated in the libcurl instructions Readme in the folder winbuild: -我构建了静态调试 Zlib,并如 winbuild 文件夹中的 libcurl 说明自述文件所述:

  • I created a folder deps:我创建了一个文件夹 deps:

  • deps/include: copied zconf.h and zlib.h here deps/include: 复制 zconf.h 和 zlib.h 这里

  • deps/lib: copied zlib_a.lib here (x32 debug) deps/lib:在此处复制 zlib_a.lib(x32 调试)

Then i opened the VS2019(x32) command prompt and entered the command:然后我打开 VS2019(x32) 命令提示符并输入命令:

nmake /f Makefile.vc mode=static vc=16 debug=yes WITH_ZLIB=static nmake /f Makefile.vc mode=static vc=16 debug=yes WITH_ZLIB=static

But I immediately get an error!!!但是我立即得到一个错误!

configuration name: libcurl-vc16-x86-debug-static-zlib-static-ipv6-sspi-schannel
        cl /Od /D_DEBUG /RTC1 /Z7 /LDd /MTd /DCURL_STATICLIB /I. /I ../lib /I../include /nologo /W4 /EHsc /DWIN32 /FD /c /DBUILDING_LIBCURL /DHAVE_ZLIB_H /DHAVE_ZLIB /DHAVE_LIBZ  /I"../../deps/include"  /DUSE_WIN32_IDN /DWANT_IDN_PROTOTYPES  /DUSE_IPV6  /DUSE_WINDOWS_SSPI /DUSE_SCHANNEL /Fo"..\builds\libcurl-vc16-x86-debug-static-zlib-static-ipv6-sspi-schannel-obj-lib/content_encoding.obj"  ..\lib\content_encoding.c
content_encoding.c
..\lib\content_encoding.c(30): fatal error C1083: **Unable to open the enable file: zlib.h**: No such file or directory,
NMAKE : fatal error U1077: "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX86\x86\cl.EXE" : return code "0x2"
Stop.
NMAKE : fatal error U1077: "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX86\x86\nmake.exe" : return code "0x2"
Stop.

Unable to open the enable file: zlib.h无法打开启用文件:zlib.h

What the hell is going on here?这到底是怎么回事? Why can't I open this file?为什么我打不开这个文件? Which path is it trying to open the zlib.h file?它试图打开 zlib.h 文件的路径是什么?

Where have you created the directory deps ?您在哪里创建了目录deps

cl /I. /I ../lib /I../include /I"../../deps/include" ..\lib\content_encoding.c

The working directory is winbuild , the directory deps is expected to be in ../../deps .工作目录是winbuild ,目录deps预计在../../deps Assuming you cloned curl sources to curl , the directory deps should be in the same directly where curl is, ie near curl . Assuming you cloned curl sources to curl , the directory deps should be in the same directly where curl is, ie near curl .

curl/
  ...
  lib/
  winbuild/
  ...
deps/
  include/
    zlib/
      zconf.h
      zlib.h

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM