Sponsored Content
Top Forums Programming undefined reference to `pthread_create' Post 95178 by linuxpenguin on Sunday 8th of January 2006 11:48:25 PM
Old 01-09-2006
how did you compile this code. use the pthread library

cc -o outputfile c_code_file -lpthread
This User Gave Thanks to linuxpenguin For This Post:
 

9 More Discussions You Might Find Interesting

1. Programming

Undefined reference to Error

Hello, plz help me out with this error, i am getting this error when i compile my code with gcc. /usr/lib/gcc-lib/i386-redhat-linux/3.3.2/../../../crt1.o(.text+0x18): In function `_start': : undefined reference to `main' /tmp/cciLxqdV.o(.text+0x3c): In function `HandleUserTransaction()':... (2 Replies)
Discussion started by: svh
2 Replies

2. Programming

about undefined reference for 'sinf'

I m writting code in c using another library(parapin) and making Makefile .but there is a error like undefined reference to `sinf' undefined reference to `ceilf' although i have added math.h library in my code . I tried to run simple programme using math.h and it run.but in making Makefile it... (2 Replies)
Discussion started by: bharat suthar
2 Replies

3. Programming

undefined reference to `__ctype_b'

when i compile my program, i meet the following error: ... undefined reference to `__ctype_b' ... anybody knows which shared library should be linked during make? thanks a lot! (6 Replies)
Discussion started by: princelinux
6 Replies

4. Programming

undefined reference to 'function'

Hi, i want to compile a code where fortran calls c . First I compiled C module ,it has pass by gcc. However, after generating .o file. I compiled C and fortran files together by intel fortran and it failed " undefined reference to 'vicerror'". vicerror is a function. I do not know why. (1 Reply)
Discussion started by: austinhsu
1 Replies

5. Programming

undefined reference to pthread_create

I try to compile a sample c code in fedora eclipse 3.2 as managed makefile using pthread library,it shows some error on pthread functions.Error is of undefined reference to pthread.Anybody guide me to solve this problem. Thanking you (1 Reply)
Discussion started by: sujith4u87
1 Replies

6. Programming

undefined reference to `pthread_create'

Hi guys. H was learning posix threads in C with anjuta IDE. it gives me undefined reference to `pthread_create' I know i should compile it like: gcc -lpthread main.c how should i import this configuration in anjuta so i can compile inside it? (2 Replies)
Discussion started by: majid.merkava
2 Replies

7. Homework & Coursework Questions

undefined reference help

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: i know when undefined reference shows up the program is saying it is not link to that function but the problem... (1 Reply)
Discussion started by: mgyeah
1 Replies

8. Homework & Coursework Questions

undefined reference help

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: The problem is a function which i typed although it kept saying that it is a undefined reference still. other... (1 Reply)
Discussion started by: mgyeah
1 Replies

9. UNIX for Dummies Questions & Answers

Undefined reference - so I have to edit the Makefile?

.......... (1 Reply)
Discussion started by: larry burns
1 Replies
PTHREAD(3)						   BSD Library Functions Manual 						PTHREAD(3)

NAME
pthread -- POSIX Threads Library LIBRARY
POSIX Threads Library (libpthread, -lpthread) SYNOPSIS
#include <pthread.h> cc [flags] files -lpthread [libraries] DESCRIPTION
The pthread library provides an implementation of the standard POSIX threads library. The NetBSD implementation is based on 1:1 thread model, therefore each pthread has a kernel thread, called a light-weight process (LWP). Note that the system private thread interfaces upon which the pthread library is built are subject to change without notice. In order to remain compatible with future NetBSD releases, programs must be linked against the dynamic version of the thread library. Statically linked programs using the POSIX threads framework may not work when run on a future version of the system. FUNCTIONS
The following functions comprise the core of the pthread library: Function Description pthread_attr(3) thread attribute operations pthread_barrier_destroy(3) destroy a barrier pthread_barrier_init(3) create a barrier pthread_barrier_wait(3) wait for a barrier pthread_barrierattr(3) barrier attribute operations pthread_cancel(3) cancel the execution of a thread pthread_cleanup_push(3) add or remove cleanup functions pthread_cond_broadcast(3) unblock one or more threads pthread_cond_destroy(3) destroy a condition variable pthread_cond_init(3) create a condition variable pthread_cond_wait(3) wait for a condition variable pthread_condattr(3) condition attribute operations pthread_create(3) create a new thread pthread_detach(3) detach a thread pthread_equal(3) compare thread identifiers pthread_exit(3) terminate the calling thread pthread_getspecific(3) get a thread-specific data value pthread_join(3) wait for thread termination pthread_key_create(3) thread-specific data key creation pthread_key_delete(3) delete a thread-specific data key pthread_kill(3) send a signal to a specific thread pthread_mutex_destroy(3) free a mutex pthread_mutex_init(3) create a mutex pthread_mutex_lock(3) acquire a lock on a mutex pthread_mutex_unlock(3) unlock a mutex pthread_mutexattr(3) mutex attribute operations pthread_once(3) dynamic package initialization pthread_rwlock_destroy(3) destroy a read/write lock pthread_rwlock_init(3) initialize a read/write lock pthread_rwlock_rdlock(3) acquire a read/write lock for reading pthread_rwlock_unlock(3) release a read/write lock pthread_rwlock_wrlock(3) acquire a read/write lock for writing pthread_rwlockattr(3) read/write lock attribute operations pthread_schedparam(3) thread scheduling manipulation pthread_self(3) get the ID of the calling thread pthread_setspecific(3) get a thread-specific data value pthread_sigmask(3) manipulate a thread's signal mask pthread_spin_destroy(3) destroy a spin lock pthread_spin_init(3) initialize a spin lock pthread_spin_lock(3) acquire a spin lock pthread_spin_unlock(3) release a spin lock pthread_testcancel(3) set cancelability state ENVIRONMENT
The following environment variables affect the behavior of the library: PTHREAD_DIAGASSERT Possible values are any combinations of: A Report errors to application by error return, but do not abort. a Abort on errors, creating a core dump for further debugging. E Do not log errors to stdout. e Log errors to stdout. L Do not log errors via syslogd(8). l Log errors via syslogd(8). If not set in the environment, the pthread library behaves as if AEL has been specified. PTHREAD_STACKSIZE Integer value giving the stack size in kilobytes. This allows to set a smaller stack size than the default stack size. The default stack size is the current limit on the stack size as set with the shell's command to change limits (limit for csh(1), or ulimit for sh(1)). SEE ALSO
David R. Butenhof, Programming with POSIX(R) Threads, Addison-Wesley, 1997. STANDARDS
The pthread library conforms to IEEE Std 1003.1-2001 (``POSIX.1''). CAVEATS
Due to limitations in the current pthread implementation, makecontext(3) and sigaltstack(2) should not be used in programs which link against the pthread library (whether threads are used or not). BSD
May 16, 2010 BSD
All times are GMT -4. The time now is 02:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy