linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* compiling programs which use pthreads
@ 2004-01-25  9:36 syedk
  2004-01-25  9:23 ` David Erman
  2004-01-25  9:56 ` Jan-Benedict Glaw
  0 siblings, 2 replies; 4+ messages in thread
From: syedk @ 2004-01-25  9:36 UTC (permalink / raw)
  To: linux-c-programming

Hi all,
     I am getting strange results while compiling programs which use
pthreads.
I am working on a RedHat Linux on a 2.4 kernel.
to start with i wrote a simple program as follows:


#include <pthread.h>
#include <stdio.h>
void * hello(void *);
main()
{
        pthread_t tid;
        pthread_create(&tid,NULL,hello,NULL);
}
void *hello(void *arg)
{
        printf("Hello World/n");
}

but  when i tried to compile using gcc it is giving linktime error:
undefined reference to pthread_create.
but why is it giving this error when the header file pthread.h is
present.
when i tried to do cat /proc/ksyms | grep pthread_create
no matches were found. Does that mean that pthread library is not
installed in my system?

Can anyone suggest how to hack this and compile my program apart from
downloading some freely available user-level libraries(like gnu
pthreads).
Thanx
Syed SK



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-01-25  9:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-25  9:36 compiling programs which use pthreads syedk
2004-01-25  9:23 ` David Erman
2004-01-25  9:44   ` Cesar Rincon
2004-01-25  9:56 ` Jan-Benedict Glaw

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).