Problem polega na tym:
Kod: Zaznacz cały
zad.c:(.text+0x825): undefined reference to 'pthread_create'
collect2: ld returned 1 exit status
Kod: Zaznacz cały
int main()
{
pthread_t g1, g2,pac;
time_t start,end;
clock_t start2,end2;
double dif2;
int i,il,k,k2,l,p1=70,p2=80,p3=90;
pthread_mutex_init(&mut[0],NULL);
pthread_mutex_init(&mut[1],NULL);
pthread_mutex_init(&mut[2],NULL);
pthread_create(&g1, NULL, &gabinet1, NULL); TUTAJ
pthread_create(&g2, NULL, &gabinet2, NULL); JEST
pthread_create(&pac, NULL, &pacjenci, NULL); BLAD
srand(time(0));
time (&start);
while(dif<dlp)
{
time (&end);
dif = difftime (end,start);
}
printf("Koniec czasu przyjec pacjentow\n");
while(g1z!=0||g2z!=0||dl_kol1!=-1||dl_kol2!=-1);
printf("Koniec pracy przychodni\n");
return 0;
}