32

I have just started to learn C++ for school, and I'm trying to download the compiler MinGW to compile my source code. However, every time I try to compile a program an error message shows up saying that zlib1.dll is missing.

This is the error message

the program can't start because zlib1.dll is missing from your computer

I have tried installing/re-installing with no luck. I don't know what's the problem here?

Can anyone please help me with this problem as I have some homework that I need to do but I can't without the compiler.

Thanks.

5
  • Where did you obtain the compiler from?
    – Niall
    Aug 28, 2014 at 6:29
  • mingw.org/wiki/Getting_Started
    – GamefanA
    Aug 28, 2014 at 6:30
  • Are there any zlib* dlls in the installation?
    – Niall
    Aug 28, 2014 at 6:34
  • there is only one called zlib.dll in the following path "C:\MinGW\msys\1.0\lib\perl5\vendor_perl\5.8\msys\auto\Compress\Raw\Zlib"
    – GamefanA
    Aug 28, 2014 at 6:37
  • Seems to a post install step of some sort, check the answer
    – Niall
    Aug 28, 2014 at 6:43

3 Answers 3

52

I had this same problem, but fixed it like this:

  1. I ran the MinGW Installation Manager (e.g. C:\MinGW\libexec\mingw-get\guimain.exe).

  2. I navigated to All Packages -> MinGW -> MinGW Libraries.

  3. I checked the boxes next to mingw32-libz (dev & dll).

    Screenshot

  4. I went to Installation -> Apply Changes.

Now everything worked properly.

2
  • This worked perfectly for me. Shame the latest version still doesn't work with std::stoi, though. Jun 12, 2015 at 19:54
  • libz is also included if you install mingw32-base (under MinGW > MinGW Base System) Jan 24, 2016 at 17:58
13

From the MinGW getting started; an automated GUI installer assistant, or use mingw-get, is available (installed as "MinGW Installation Manager") and can be used to install additional libraries and manage dependencies. For the missing zlib libraries, add the mingw32-libz libraries as required.


It seems to have been an issue previously here on super user. It seems you may be able to get them directly from the zlib website. Open Babel has some info on it being required to be copied afterwards (together with some other dlls).


Alternatives include using the mingw-w64 distros from nuwen or mingw-builds. I've never had any issue getting these up and going. They also support x64 builds.

2
  • Thanks, that'll do for now.
    – GamefanA
    Aug 28, 2014 at 7:26
  • 4
    Just an fyi for anyone who doesn't know where to put the dll, it's /MinGW/bin/ Aug 29, 2015 at 1:12
8

Had same problem here, I've just used mingw-get install mingw32-libzat the cmd and it worked.

1
  • This should be the accepted answer and/or combined with the graphical user interface answer by Doug.
    – lawlist
    Sep 29, 2015 at 15:43

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.