This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: using threads with gcc on fedora (undefined reference to pthread_create)
- From: Daniel Jacobowitz <drow at false dot org>
- To: Abid Ghufran <abid dot ghufran at gmail dot com>
- Cc: gcc <gcc at gcc dot gnu dot org>
- Date: Wed, 19 Jul 2006 09:50:32 -0400
- Subject: Re: using threads with gcc on fedora (undefined reference to pthread_create)
- References: <70c3d4ec0607190649l339bc6f7i62c1d7157abe822b@mail.gmail.com>
On Wed, Jul 19, 2006 at 02:49:18PM +0100, Abid Ghufran wrote:
> I am using thread in my application.
>
> 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.
>
> What options do I have to use when compiling my code?
> Is there any document on this?
This is a list for the developers of GCC. You may get more help on the
gcc-help list.
It sounds like you didn't link with -lpthread.
--
Daniel Jacobowitz
CodeSourcery