Jeegar Patel
Jeegar Patel

Reputation: 27230

Binary generated by MinGW compiler will work on the machine without Mingw?

see i have code like

#include<stdio.h>
#include<pthread.h>
#include<string.h>

void* thread_function(void)
{
  printf ("This is thread %d \n",pthread_self())
}
int main(int argc,char *argv[])
{
    pthread_t thread_id[argc-1];
    int i;
    int status;
    printf("argc is %d ",argc-1);
   for(i=0;i<argc-1;i++)
    {
    pthread_create (&thread_id[i], NULL , &thread_function, NULL);
    }  

    for(i=0;i<argc-1;i++)
        pthread_join(thread_id[i],NULL);   
}

Now i have compile it by MinGw compiler gcc.exe 4.6.1 and get a.exe now i want to ask you does this a.exe will work on other windows machine where MinGW is not installed?

Edit : When i compile this code by Cygwin compiler and run its binary on other windows machine without cygwin it doesnt run..says cygwin.dll is missing something like that error comes

Upvotes: 0

Views: 354

Answers (1)

Matteo Italia
Matteo Italia

Reputation: 126907

If I remember correctly it should depend only on the Microsoft CRT (msvcrt.dll, probably to one of the oldest versions available on Windows) and other system standard dlls (kernel32.dll & co.), but you can easily check it by yourself by examining your executable with the Dependency Walker.

Upvotes: 4

Related Questions