Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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
like image 474
CameFromSpace Avatar asked Jul 17 '17 12:07

CameFromSpace


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)

like image 98
Basile Starynkevitch Avatar answered Nov 12 '22 11:11

Basile Starynkevitch


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

See this answer for details.

like image 34
ulatekh Avatar answered Nov 12 '22 10:11

ulatekh