Thanks for your reply. :) Sorry for my ignorance. I don't have much
experience in programming.

David

----- Original Message -----
From: "Jason Costomiris" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, December 25, 2001 1:08 AM
Subject: Re: OT: Compiling multithreaded code


On Mon, Dec 24, 2001 at 11:25:31PM +0800, David wrote:
: I have written some multithreading code using pthread library. But when I
: compile the code, the compiling process is ok but the linking process
claims
: "undefined reference" for pthread_create( ). How can I resolve this
problem?
: I have included <pthread.h> and #define _REENTRANT but still doesn't work.
I
: suspect the library libpthread.so is bad but having replaced that file
with
: another one from Mandrake 8.0 (the file sizes are different), it
: still doesn't compile. Can anyone help me with this one? Thanks.

You're not linking against the pthread library.  You want to do something
like:

gcc -O2 foo.c -o foo -lpthread

--
Jason Costomiris <><           |  Technologist, geek, human.
jcostom {at} jasons {dot} org  |  http://www.jasons.org/
          Quidquid latine dictum sit, altum viditur.
                    My account, My opinions.



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to