libwinpthread-1.dll, libgcc_s_seh-1.dll and error 0xc000007b

1

I use the IDE CLION to program in C ++, and it took very little time. I'm doing a mini-game on the console where I need to generate random numbers.
Use rand () with the standard library and time (), but the environment recommends me to use a different generator, following the "conventions" of C ++ 11, and I have decided to use the random library in this way:

#include < random >

std::random_device rd;  
std::mt19937 mt(rd());  
std::uniform_int_distribution<int> dist(4, 77);  

roca.mover(dist(mt));  

When I run the game in the environment console, it works more or less well.

The problem comes when I want to run my game.exe on the outside, because first it tells me that I need "libgcc_s_seh-1.dll". I install it and it asks for "libwinpthread-1.dll". And when both are installed in the directory of the executable (I do not know if this is done) it tells me that the application can not be started because this error has occurred - > 0xc000007b.

I can use rand() in the traditional way, but since I am learning the language I would like to know why this error occurs, how to solve it ...

I use Windows 10 64 bits and my compiler is MinGW

    
asked by Mateo 18.01.2018 в 21:00
source

1 answer

0

Those libraries that you lack are dependencies of the compiler.

These libraries will be found in the libs folder of the compiler. You need to copy them together with the executable to work on other computers.

If the executable still does not start the problem is that more dependencies are missing.

Try to link with

-static -static-libgcc -static-libstdc++

Because these two dependencies are also usually needed with gcc / mingwin.

You can also use the dependcy walker tool to examine the executable and find out what dependencies you lack.

    
answered by 18.01.2018 в 21:49