Skip to content

winbuild: fail to build WITH_ZLIB=static#11521

Closed
moehuster wants to merge 1 commit intocurl:masterfrom
moehuster:master
Closed

winbuild: fail to build WITH_ZLIB=static#11521
moehuster wants to merge 1 commit intocurl:masterfrom
moehuster:master

Conversation

@moehuster
Copy link

No description provided.

@github-actions github-actions bot added build Windows Windows-specific labels Jul 26, 2023
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a typo, the visual studio zlibstat project's output is zlibstat.lib. Where are you getting zlibstatic.lib from? Are you using a different build method?

@moehuster
Copy link
Author

moehuster commented Jul 28, 2023

I use cmake generate visual studio project. It's zlib's bug, may be.
add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
https://github.com/madler/zlib/blob/master/CMakeLists.txt#L151

ZLIB_LIBS = zlibstat.lib
ADDITIONAL_ZLIB_CFLAGS = /DZLIB_WINAPI
!ELSEIF EXISTS("$(ZLIB_LIB_DIR)\zlibstatic.lib")
ZLIB_LIBS = zlibstatic.lib
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MarcelRaad can you confirm- unlike zlib's contrib VS project files, something like zlibstatic.lib (cmake outfile) doesn't need /DZLIB_WINAPI ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I can confirm that ZLIB_WINAPI is only defined by the VS projects by default.

@jay jay closed this in 7bfb10c Jul 29, 2023
@jay
Copy link
Member

jay commented Jul 29, 2023

Thanks

ptitSeb pushed a commit to wasix-org/curl that referenced this pull request Sep 25, 2023
- Check for zlib static library name zlibstatic.lib.

zlib's static library has a different name depending on how it was
built. zlibstatic.lib is output by cmake. zlibstat.lib is output by
their pre-generated Visual Studio project files (in the contrib
directory) and defines ZLIB_WINAPI (ie it's meant to use stdcall
instead of cdecl if you end up exporting the zlib functions).

Prior to this change the makefile only checked for the latter.

Closes curl#11521
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

4 participants