Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
644 views
in Technique[技术] by (71.8m points)

libraries - Missing zlib: cannot build Cairo for use in C++ project on Windows

I'm attempting to use Cairo as part of a C++ project. I'm new to dealing with 3rd party libraries so I'm unsure of what I'm doing and if I've missed any steps. I'm also interested in learning how to correctly download, build and include 3rd party libraries in the most consistent way possible.

Steps so far:

  • Installed MinGW64 & MSYS2.
  • Added both bin folders to system PATH (c:mingw64in & c:msysmingw64in).
  • Downloaded source code from here.
  • When running ./configure resolved missing pkg-config and libpng packages by downloading via pacman with no issue.
  • Run pacman -S mingw-w64-x86_64-zlib in the shell.

I'm now being told that I'm missing zlib and receiving this error

checking whether cairo's script surface backend feature could be enabled... no (requires zlib http://www.gzip.org/zlib/)
configure: error: recommended script surface backend feature could not be enabled

When checking the bin folder of MSYS2, the zlib.dll file is present, and using the shell tells me that I already have it installed as it is a dependency of libpng.

The aim is to build Cario and it's dependencies into a format that I can use in my project on Windows 10.

question from:https://stackoverflow.com/questions/65918996/missing-zlib-cannot-build-cairo-for-use-in-c-project-on-windows

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You probably need either mingw-w64-i686-zlib or mingw-w64-x86_64-zlib.

The zlib1.dll you found in MSYS2's /usr/bin (/bin?) is the MSYS runtime's version, and built against the POSIX-y environment MSYS2 lends from Cygwin.

The libraries you will use and build upon when compiling with the MinGW-w64 compilers available through MSYS2's package repositories are put in /mingw32 and /mingw64 subdirectories for 32 and 64-bit versions, respectively.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...