Welcome to the most active Linux Forum on the web.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 05-11-2001, 05:03 AM   #1
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
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);

Old 05-28-2001, 02:07 PM   #3
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
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++


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 > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:01 AM.

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