libpng
libpng copied to clipboard
error: ZLIB_VERNUM != PNG_ZLIB_VERNUM
Hi,
I'm started a new project where I need zlib and libpng. I actually never worked with both libraries before, so after quite a bit of search I decided to use zlib-ng instead of the original zlib, as the CMAKE support is somewhat better.
Unfortunately, when compiling my project on Ubuntu 20.04 is get the following message from libpng:
error: ZLIB_VERNUM != PNG_ZLIB_VERNUM
I'm using the following settings in my CMakeList.txt:
# Add zlib
message("-- Configuring build scripts for zlib")
set(ZLIB_COMPAT ON CACHE BOOL "Override option" FORCE)
set(WITH_NEW_STRATEGIES OFF CACHE BOOL "Override option" FORCE)
add_subdirectory(zlib-ng)
# Add libpng
message("-- Configuring build scripts for libpng")
set(PNG_BUILD_ZLIB ON CACHE BOOL "Override option" FORCE)
set(PNG_SHARED OFF CACHE BOOL "Override option" FORCE)
set(PNG_EXECUTABLES OFF CACHE BOOL "Override option" FORCE)
set(PNG_STATIC ON CACHE BOOL "Override option" FORCE)
set(PNG_TESTS OFF CACHE BOOL "Override option" FORCE)
add_subdirectory(libpng)
Am I missing something or is zlib-ng not really compatible with libpng 1.6.37?
Any help would be highly appreciated to get this working.
Thanks, Marco
See https://github.com/zlib-ng/zlib-ng/issues/1174.