05-19-2010
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
9 More Discussions You Might Find Interesting
1. Programming
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
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
Hi
I wanted to learn communication between threads and I used a simple example but
I faced with this error while I have a sofware that uses this functions without
any problem
so would you please help me to know the reason
thanks for your help and great favor.
#include <pthread.h>... (2 Replies)
Discussion started by: netman
2 Replies
4. Programming
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
5. Programming
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
6. Programming
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
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
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
.......... (1 Reply)
Discussion started by: larry burns
1 Replies
LEARN ABOUT SUNOS
pthread_spin_lock
pthread_spin_lock(3C) Standard C Library Functions pthread_spin_lock(3C)
NAME
pthread_spin_lock, pthread_spin_trylock - lock a spin lock object
SYNOPSIS
cc -mt [ flag... ] file... [ library... ]
#include <pthread.h>
int pthread_spin_lock(pthread_spinlock_t *lock);
#include <pthread.h>
int pthread_spin_trylock(pthread_spinlock_t *lock);
DESCRIPTION
The pthread_spin_lock() function locks the spin lock referenced by lock. The calling thread acquires the lock if it is not held by another
thread. Otherwise, the thread spins (that is, does not return from the pthread_spin_lock call()) until the lock becomes available. The
results are undefined if the calling thread holds the lock at the time the call is made.
The pthread_spin_trylock() function locks the spin lock referenced by lock if it is not held by any thread. Otherwise, the function fails.
The results are undefined if either of these functions is called with an uninitialized spin lock.
RETURN VALUES
Upon successful completion, these functions returns 0. Otherwise, an error number is returned to indicate the error.
ERRORS
The pthread_spin_trylock() function will fail if:
EBUSY A thread currently holds the lock.
These functions may fail if:
EINVAL The value specified by lock does not refer to an initialized spin lock object.
The pthread_spin_lock() function may fail if:
EDEADLK The calling thread already holds the lock.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
|MT-Level |MT-Safe |
+-----------------------------+-----------------------------+
SEE ALSO
pthread_spin_destroy(3C), pthread_spin_unlock(3C), attributes(5), standards(5)
SunOS 5.10 30 Jan 2004 pthread_spin_lock(3C)