You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
build in windows with zlib should add ZLIB_WINAPI in MakefileBuild.vc #3133
curl version:7.61.1
If you want to use nmake to build curl with zlib on windows ,you should modify the file MakefileBuild.vc.
Change the ZLIB_CFLAGS value like this: ZLIB_CFLAGS = /DHAVE_ZLIB_H /DHAVE_ZLIB /DHAVE_LIBZ /DZLIB_WINAPI /I"$(ZLIB_INC_DIR)"
I'd also be interested as to the "why do we need ZLIB_WINAPI ?",, and what version of ZLIB this applies to? I have been building ZLIB as a dependency of CURL for several years and not yet hit on this need.
/* If building or using zlib with the WINAPI/WINAPIV calling convention,
* define ZLIB_WINAPI.
* Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
*/
30 second googling appears to indicate that it changes the expectations on the caller (it turns on __stdcall) which makes me nervous, but no more than that.
I'd also be interested as to the "why do we need ZLIB_WINAPI ?",, and what version of ZLIB this applies to? I have been building ZLIB as a dependency of CURL for several years and not yet hit on this need.
/* If building or using zlib with the WINAPI/WINAPIV calling convention,
* define ZLIB_WINAPI.
* Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
*/
30 second googling appears to indicate that it changes the expectations on the caller (it turns on __stdcall) which makes me nervous, but no more than that.
The zlib version I used is 1.2.11 . I use nmake to build the curl. If I don't add ZLIB_WINAPI in MakefileBuild.vc. It'll have link error _zlibVersion .
I also rather suspect the zlib build to be the weird party here and not the curl build. People have built curl with zlib using this for quite some time. It also seems unlikely that zlib would suddenly have changed to require this define just to build with a specific version.
I'm about to do a full dependency build (openSSL 1.1.1, Curl 7.62.latest, Zlib 1.2.11) (using VC15). If this doesn't fail I don't know what to say.
And as an aside to @bagder I don't actually care about this change making it or not since I can chose to build without that call. I just worry when there is something I don't understand.
thanks to @wkwspirit for bearing with my questions.
I'm about to do a full dependency build (openSSL 1.1.1, Curl 7.62.latest, Zlib 1.2.11) (using VC15). If this doesn't fail I don't know what to say.
And as an aside to @bagder I don't actually care about this change making it or not since I can chose to build without that call. I just worry when there is something I don't understand.
thanks to @wkwspirit for bearing with my questions.
I use openSSL 1.1.1,Curl 7.61.1(I can't find the 7.62),zlib 1.2.11(using vc15).I succeed.If you paste the error info ,maybe I can find the reason.
What I am unsure is whether the tools are there to allow is from the top level make file Makefile.vc. It seems that the subsidiary file MakefileBuild.vc just builds the ZLIB_CFLAGS if it needs them to a fixed value.
One could say "Curl doesn't work with ZLIB_WINAPI", which would certainly be a suggestion for 7.62.0, or one could document how to call the subsidiary file directly (I do this, but I would't want to document it).
Can we assume that if zlibwapi.lib exists that always means zlib was built with ZLIB_WINAPI? Then we could add ZLIB_WINAPI conditionally if zlibwapi is found.
Activity
bagder commentedon Oct 13, 2018
Thanks, can you provide your suggested fix as a full patch or even a PR?
rodwiddowson commentedon Oct 13, 2018
I'd also be interested as to the "why do we need
ZLIB_WINAPI?",, and what version of ZLIB this applies to? I have been building ZLIB as a dependency of CURL for several years and not yet hit on this need.30 second googling appears to indicate that it changes the expectations on the caller (it turns on
__stdcall) which makes me nervous, but no more than that.wkwspirit commentedon Oct 13, 2018
I have pulled a request.
wkwspirit commentedon Oct 13, 2018
The zlib version I used is 1.2.11 . I use nmake to build the curl. If I don't add ZLIB_WINAPI in MakefileBuild.vc. It'll have link error
_zlibVersion.rodwiddowson commentedon Oct 13, 2018
Odd. I build 7.62 yesterday against that with no problems, however I built my own zlib, which might be the difference. Where did you get yours from?
Thanks/
bagder commentedon Oct 13, 2018
I also rather suspect the zlib build to be the weird party here and not the curl build. People have built curl with zlib using this for quite some time. It also seems unlikely that zlib would suddenly have changed to require this define just to build with a specific version.
wkwspirit commentedon Oct 13, 2018
I download the zlib from https://github.com/madler/zlib .The lastest release version is 1.2.11.
rodwiddowson commentedon Oct 13, 2018
Build using Make or VC? I don't see that being defined in the makefile, but it does appear to be defined in the (contributed) VC projects....
wkwspirit commentedon Oct 13, 2018
In the
winbuilddirectory,useNMAKE.rodwiddowson commentedon Oct 13, 2018
In that case I'm lost.
I'm about to do a full dependency build (openSSL 1.1.1, Curl 7.62.latest, Zlib 1.2.11) (using VC15). If this doesn't fail I don't know what to say.
And as an aside to @bagder I don't actually care about this change making it or not since I can chose to build without that call. I just worry when there is something I don't understand.
thanks to @wkwspirit for bearing with my questions.
wkwspirit commentedon Oct 13, 2018
I use openSSL 1.1.1,Curl 7.61.1(I can't find the 7.62),zlib 1.2.11(using vc15).I succeed.If you paste the error info ,maybe I can find the reason.
rodwiddowson commentedon Oct 13, 2018
32 bit build fine, 64 bt under way. ZLIB_WINAPI not defined.
(Yes I know its an unorthodox build, but it does what we need which is using windows standard file names for debug DLLs)
wkwspirit commentedon Oct 13, 2018
Sorry,I don't know how you can compile success without ZLIB_WINAPI.
5 remaining items
rodwiddowson commentedon Oct 17, 2018
I'd agree.
What I am unsure is whether the tools are there to allow is from the top level make file
Makefile.vc. It seems that the subsidiary fileMakefileBuild.vcjust builds theZLIB_CFLAGSif it needs them to a fixed value.One could say "Curl doesn't work with ZLIB_WINAPI", which would certainly be a suggestion for 7.62.0, or one could document how to call the subsidiary file directly (I do this, but I would't want to document it).
jay commentedon Oct 19, 2018
We would need to catch it before then. Right now we have code like this:
curl/winbuild/MakefileBuild.vc
Lines 236 to 246 in 432eb5f
Can we assume that if zlibwapi.lib exists that always means zlib was built with ZLIB_WINAPI? Then we could add ZLIB_WINAPI conditionally if zlibwapi is found.
MarcelRaad commentedon Oct 19, 2018
As I wrote in #3135 (comment), I think that would be best. And also for its static version
zlibstat.lib.jay commentedon Oct 19, 2018
I missed that or maybe it was stuck in my unconscious, apologies.
bagder commentedon Jan 10, 2019
Is there anyone who wants to work on this? Otherwise this will go to the KNOWN_BUGS pile soon.
MarcelRaad commentedon Jan 10, 2019
I think I can do that!
winbuild: conditionally use /DZLIB_WINAPI