0

I just downloaded Zlib's source code from the website -> https://zlib.net/

 zlib source code, version 1.2.11, zipfile format ....
   -  US (zlib.net)

And I'm struggling with setting up this library, So I'm trying to get some help from some experienced people. And an example will be helpful for me to start with.

I'm using gcc 8.1.0, windows.

Thanks!

Cozer
  • 15
  • 5
  • 2
    You never mentioned what, *specifically* is the problem. If it is a build issue, imho the easiest way to build zlib on *any* platform is via cmake. It really is the cat's pajamas (for a LOT of things, including that). – WhozCraig Jan 04 '22 at 09:19
  • ***I'm struggling with setting up this library*** what issues are you facing? – kiner_shah Jan 04 '22 at 09:19
  • I'm trying to build the zlib library but I don't know what to exactly do – Cozer Jan 04 '22 at 09:33
  • Assuming you have mingw properly installed, configured, and the bin folder in your windows PATH correctly, using cmake for the build is [described here](https://stackoverflow.com/questions/4101456/running-cmake-on-windows) – WhozCraig Jan 04 '22 at 09:44
  • 1
    You could switch to have msys2 provide your mingw and use the msys2 package manager download and install a compatible zlib for you with little effort. [https://www.msys2.org/](https://www.msys2.org/) and [https://packages.msys2.org/package/mingw-w64-x86_64-zlib?repo=mingw64](https://packages.msys2.org/package/mingw-w64-x86_64-zlib?repo=mingw64) the install command is `pacman -S mingw-w64-x86_64-zlib` from the mingw64 terminal. msys also comes with a newer mingw with gcc-11.2 – drescherjm Jan 04 '22 at 20:15
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Jan 11 '22 at 16:06
  • already solved. – Cozer Jan 11 '22 at 19:04

1 Answers1

1

the steps I use:

  1. open cmd.exe

  2. type sh You should see a prompt like that:

    sh-3.1$

  3. once in sh, change dir to your lib dir., so for me is:

    cd /c/Users/ing.conti/Documents/zlib1211/zlib-1.2.11/

  4. when there, you should ber allowed to call ./configure You should see a message saying:

"Please use win32/Makefile.gcc instead." if so:

  1. type:

    make -fwin32/Makefile.gcc; make test testdll -fwin32/Makefile.gcc

as per readme for windows.

You should see:

enter image description here

Now their tests run fine.

  1. You will see a bunch of *.o and *.exe inside. (delete manually if You want to see recompiling again, OR use: make clean -fwin32/Makefile.gcc)

You can run *.exe BOTH from "sh" AND from cmd line of windows.

Now You can start modifying sources and / or Makefile.gcc, or duplicate it....

ingconti
  • 10,876
  • 3
  • 61
  • 48