You have built an .exe file that depends on libwinpthread-1.dll.
Solutions to make sure the .exe can run:
- Add the MinGW
binpath to your PATH solibwinpthread-1.dll- this would only fix it for your own system so I wouldn't recommend this if you want to use the .exe file on other systems. - Copy
libwinpthread-1.dllfrom MinGW in the same folder as your .exe file. This is generally needed for any shared dependancy library your .exe is linked against. - Build a static .exe (
--staticlinker flag) to avoid the shared (.dll) dependancy.
You have built an .exe file that depends on libwinpthread-1.dll.
Solutions to make sure the .exe can run:
- Add the MinGW
binpath to your PATH solibwinpthread-1.dll- this would only fix it for your own system so I wouldn't recommend this if you want to use the .exe file on other systems. - Copy
libwinpthread-1.dllfrom MinGW in the same folder as your .exe file. This is generally needed for any shared dependancy library your .exe is linked against. - Build a static .exe (
--staticlinker flag) to avoid the shared (.dll) dependancy.
Yes! probably is an error, cause MinGW is a bit stinky when it comes to DLLs
Here are some things you have to check:
Make sure the variable helding the location of MinGW is named "path"
and its pointing at: C:\MinGW64\bin
Console app won't work on other PCs (libwinpthread-1.dll was not found)
`libwinpthread-1.dll` was not found
c++ - cc1.exe System Error - libwinpthread-1.dll missing - But it isn't - Stack Overflow
libwinpthread-1.dll was not found - LMMS • Forums
Videos
opening the .exe file on another PC gives the error: code execution cannot proceed because libwinpthread-1.dll was not found. reinstalling the program may fix this problem.
I suspect it has something to do with the way I compiled the program? I only used VScode and g++. I used the following command to compile the code:
g++ name.cpp -o name.exe -lwinmm
#include <windows.h>
#include <iostream>
#include <stdlib.h>
#include <chrono>
#include <thread>
using namespace std::this_thread;
using namespace std::chrono;
void printCake(){
char arr[][100] = {
" * *\n",
" *\n",
" *\n",
" *\n",
" *\n",
" *\n",
" *\n",
" *\n",
" * *\n",
" *\n",
" * *\n",
" *\n",
" ( )\n",
" ) (*) (*) (\n",
" * (*) | | (*)\n",
" | |~| |~| | *\n",
" |~| | | | | |~|\n",
" | | | | | | | |\n",
" ,| |a@@@@| |@@@@@@@@@@@| |@@@@a| |.\n",
" .,a@@@| |@@@@@| |@@@@@@@@@@@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' \n",
" `%%%%%%%'\n",
" `%%%%%'\n",
" %%%\n",
" %%%%%\n",
" .,%%%%%%%,.\n",
" ,%%%%%%%%%%%%%%%%%%%,\n",
" HAPPY BIRTHDAY!\n"
};
int length = sizeof(arr) / 100;
for(int i = 0; i < length; i++){
sleep_for(nanoseconds(370000000));
std::cout << arr[i];
}
}
int main(){
PlaySound(TEXT("song1.wav"), 0, SND_ASYNC);
printCake();
std::cout << "the end :)\n";
system("pause");
return 0;
}any sort of advice would be greatly appreciated.
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.
- "Windows Key"+ Pause/Break
- On the left there is "Advanced System settings"
- On the bottom of this window there is a button called "Environment Variables"
- Click on the name "Path"
- Click on "edit" under System Variables
- Add your MinGW directory there. For me that was
C:\MinGW\bin
I Hope I could help. If not you, maybe someone else.
I consider it best to statically link the libraries needed. This means that the executable can be run anywhere, without having to look for them. To do this, use the -static flag in the linker.
For example:
g++.exe -o ......\bin\connect.exe obj\Release\src\connect.o -static