LinuxQuestions.org
Visit Jeremy's Blog.
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 05-11-2001, 05:03 AM   #1
khokhar
LQ Newbie
 
Registered: May 2001
Posts: 1

Rep: Reputation: 0

The Plateform is linux and language is c++.TO create a thread i have included the <pthread.h> file but when i compile my programe there is a linker error "undefined refrence to pthread_create()".

I want to know which is the required library in which pthread_create() is defined. so that the linking phase is completed.
Have a nice wishes for the helper.
 
Old 05-11-2001, 05:03 PM   #2
doodah
Member
 
Registered: Apr 2001
Location: Columbus,OH
Distribution: slackware
Posts: 122

Rep: Reputation: 15
yes pthread_create is in pthread.h, you may have a wrong argument or maybe missing an argument. here is the prototype for it.

int pthread_create(pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine)(void*), void *arg);

_peace
 
Old 05-28-2001, 02:07 PM   #3
UsurpiorHarbour
LQ Newbie
 
Registered: May 2001
Posts: 8

Rep: Reputation: 0
Did you remember the compile flags needed for pthread programs?
 
Old 02-02-2004, 10:39 AM   #4
Tafta
Member
 
Registered: Jan 2003
Location: Bandung, Indonesia
Distribution: Mandrake, SUSE, RedHat
Posts: 55

Rep: Reputation: 15
gcc pthread_create.c -o pthread_create -lpthread

you can replace gcc with g++
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
How to install .o files into library ieydis Linux - Software 1 11-23-2005 10:38 PM
looking for library files Bob Moore Linux - Software 3 08-27-2004 04:30 PM
Corrupted Library Files Star Child Linux - General 1 04-07-2004 01:13 PM
Library files agp Linux - Software 3 12-17-2002 04:52 PM
pthread_create doesn't work at shared library chenjifu Programming 0 05-10-2001 09:46 PM

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

All times are GMT -5. The time now is 09:05 PM.

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