LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-10-2006, 10:44 PM   #1
slumy
LQ Newbie
 
Registered: Jun 2006
Posts: 1

Rep: Reputation: 0
Question pthread_create error


hello,
I have a problem when I practice c program of "pthread_create",
CODE AS:
pthread_create(&thread1,NULL,count_number,(void *)&args1);

my platform is redhat 9.0 and the error message as below:

/tmp/ccEMK4XC.o(.text+0x21): In function `main':
: undefined reference to `pthread_create'
/tmp/ccEMK4XC.o(.text+0x39): In function `main':
: undefined reference to `pthread_create'
/tmp/ccEMK4XC.o(.text+0x49): In function `main':
: undefined reference to `pthread_join'
/tmp/ccEMK4XC.o(.text+0x59): In function `main':
: undefined reference to `pthread_join'
collect2: ld returned 1 exit status

what's this mean?
thanks.
 
Old 06-10-2006, 10:55 PM   #2
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
Did you include the library when you linked?
Code:
$ gcc some_file.c -o some_executable -lpthread
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
pthread_create returned an error. 12 12 davebwithane Linux - Software 6 09-29-2009 01:44 AM
pthread_create... os2 Programming 4 05-26-2005 03:09 PM
error on pthread_create? adamjmac Programming 2 05-23-2005 06:21 PM
Pthread_create rahul_kulkarni Programming 4 02-10-2005 11:48 AM
pthread_create tushar123 Programming 2 06-07-2004 08:15 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration