【发布时间】:2021-10-06 14:27:45
【问题描述】:
我正在尝试通过 Microsoft 可视化构建工具安装支持 HTTP2 的 libcurl。看起来,使用 ubuntu,你可以使用 --with-http2=path/to-nghttp2。但我无法执行该命令,并且我不知道 Windows 中的等效命令。我已经安装了 nghttp2 和 openssl。我应该在原生构建工具的哪个位置插入告诉 libcurl 构建支持 http2 的命令?
尝试这样做不起作用nmake /f Makefile.vc mode=static vc=16 debug=no DUSE_NGHTTP2=OFF。该库构建但不允许 http2 请求。使用 curl cli 时,使用此选项后它不会给我错误代码 1) 不受支持的协议,但不会使用 HTTP2。也试过 DUSE_NGHTTP2=ON
C:\Users\ball\Desktop\curl\curl-7.79.1\winbuild>nmake /f Makefile.vc mode=static vc=16 debug=no MACHINE=x64 WITH_NGHTTP2=static NGHTTP2_PATH="C:\\Users\\ball\\Desktop\\nghttp2\\nghttp2-1.45.1\\lib\\includes\\"
Microsoft (R) Program Maintenance Utility Version 14.29.30133.0
Copyright (C) Microsoft Corporation. All rights reserved.
configuration name: libcurl-vc16-x64-release-static-ipv6-sspi-schannel-nghttp2-static
cl /O2 /DNDEBUG /MT /DCURL_STATICLIB /I. /I ../lib /I../include /nologo /W4 /EHsc /DWIN32 /FD /c /DBUILDING_LIBCURL /DUSE_WIN32_IDN /DWANT_IDN_PROTOTYPES /DUSE_IPV6 /DUSE_WINDOWS_SSPI /DUSE_SCHANNEL /DUSE_NGHTTP2 /DNGHTTP2_STATICLIB /I"C:\\Users\\ball\\Desktop\\nghttp2\\nghttp2-1.45.1\\lib\\includes\\include" /Fo"..\builds\libcurl-vc16-x64-release-static-ipv6-sspi-schannel-nghttp2-static-obj-lib/altsvc.obj" ..\lib\altsvc.c
altsvc.c
C:\Users\ball\Desktop\curl\curl-7.79.1\lib\http.h(38): fatal error C1083: Cannot open include file: 'nghttp2/nghttp2.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\HostX64\x64\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\HostX64\x64\nmake.exe"' : return code '0x2'
Stop.
C:\Users\ball\Desktop\curl\curl-7.79.1\winbuild>```
我也尝试过使用单个黑斜线并且没有 qoutes... 我可以确认文件夹和文件存在并且在此路径中:C:\Users\ball\Desktop\nghttp2\nghttp2-1.45.1\lib\包括\nghttp2\nghttp2.h
【问题讨论】:
标签: visual-studio visual-studio-2019 libcurl