Why Do I Get the Error "The Program Can't Start Because Msys-2.0. Dll Is Missing from Your Computer"? Is There a Fix?

I have written a long program in C, so I am not writing the whole code. These are the libraries I a using (in case it matters)

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <windows.h>
#include <time.h>
#include <sys/types.h>
#include <dirent.h>
#include "xlsxwriter.h"

The program runs perfectly on my Windows computer, and in my work computer as well where I have the same programs.

But when I am running in on a colleagues computer this error appears:

System error:
The program can't start because msys-2.0.dll is missing from your computer.
Try reinstalling the program to fix this problem.

Is there some way to make it work without installing the whole visual studio?

Rookie C programmer here!:)

Edit: I am compiling like this:

gcc Example.c -o Example -static-libgcc -std=c99 -lxlsxwriter -lz
6

2 Answers

MSYS is probably a MinGW related runtime library (perhaps its C standard library).

You need to install it on any Windows computer executing a binary compiled with MinGW.

See also this question.

You may want to ask your colleagues to install MSYS2.

Perhaps consider also building a statically linked executable (so compile and link with -static passed to GCC).

(this is only an educated guess; I never used Windows)

2

You need to build your program with the MinGW compiler, not the MSYS compiler.

See this answer for details.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

James H. Sterling

James H. Sterling

Environmental Science & Climate Journalist

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.

Share this article
Twitter Facebook Pinterest