Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cc1.exe System Error - libwinpthread-1.dll missing - But it isn't

Tags:

c++

c

gcc

mingw

I recently downloaded MinGW-w64 from Sourceforge onto my external hard drive, where all the files reside in:

E:\mingw-w64\x86_64-4.9.2-posix-seh-rt_v3-rev1\mingw64\bin

When I try compiling my first "Hello World" program using gcc on Windows 8.1, I get a cc1.exe System Error, that tells me

The program can't start because libwinpthread-1.dll is missing. Try reinstalling the program to fix the problem.

And yet, libwinpthread-1.dll (all 54,784 bytes of it) is sitting right there in the very same directory as gcc.exe. Do I really need to reinstall everything, or is something else going wrong here?

like image 230
happilymambo Avatar asked Mar 06 '15 20:03

happilymambo


1 Answers

I know this post is over two years old but I recently had the same problem when using CMake.

I fixed it by adding MinGW to the "Path" Envionment Variable: I am using Windows 10 Home.

  1. "Windows Key"+ Pause/Break
  2. On the left there is "Advanced System settings"
  3. On the bottom of this window there is a button called "Environment Variables"
  4. Click on the name "Path"
  5. Click on "edit" under System Variables
  6. Add your MinGW directory there. For me that was C:\MinGW\bin

I Hope I could help. If not you, maybe someone else.

like image 187
k1ngjulien Avatar answered Sep 27 '22 22:09

k1ngjulien