Search code examples
c++mingwzlib

Zlib Installation - mingw compiler


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!


Solution

  • 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....