From: syedk <syedk@intotoinc.com>
To: linux-c-programming@vger.kernel.org
Subject: compiling programs which use pthreads
Date: 25 Jan 2004 15:06:29 +0530 [thread overview]
Message-ID: <1075023389.27269.12.camel@qa.intotoind.com> (raw)
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
next reply other threads:[~2004-01-25 9:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-25 9:36 syedk [this message]
2004-01-25 9:23 ` compiling programs which use pthreads David Erman
2004-01-25 9:44 ` Cesar Rincon
2004-01-25 9:56 ` Jan-Benedict Glaw
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1075023389.27269.12.camel@qa.intotoind.com \
--to=syedk@intotoinc.com \
--cc=linux-c-programming@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).