Re: using thread with gcc on fedora [undefined reference to pthread_create]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Abid Ghufran kirjoitti viestissään (lähetysaika keskiviikko, 19. 
heinäkuuta 2006 16:44):
> When i try to compile the code, the gcc says that the
> "pthread_create" is an undefined reference. I have included
> the library pthread.h. Is there something else that i need to
> do.

pthread.h isn't a library, it's a header file that declares the 
functions in the pthread library. You must add the actual 
library to your program with the -lpthread linker option.

-- 
 Markku Kolkka
 markku.kolkka@xxxxxx


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux