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_attr_getinheritsched(3C)										  pthread_attr_getinheritsched(3C)

NAME
pthread_attr_getinheritsched, pthread_attr_setinheritsched - get or set inheritsched attribute SYNOPSIS
cc -mt [ flag... ] file... -lpthread [ library... ] #include <pthread.h> int pthread_attr_getinheritsched(const pthread_attr_t *restrict attr, int *restrict inheritsched); int pthread_attr_setinheritsched(pthread_attr_t *attr, int inheritsched); The functions pthread_attr_setinheritsched() and pthread_attr_getinheritsched(), respectively, set and get the inheritsched attribute in the attr argument. When the attribute objects are used by pthread_create(), the inheritsched attribute determines how the other scheduling attributes of the created thread are to be set: PTHREAD_INHERIT_SCHED Specifies that the scheduling policy and associated attributes are to be inherited from the creating thread, and the scheduling attributes in this attr argument are to be ignored. PTHREAD_EXPLICIT_SCHED Specifies that the scheduling policy and associated attributes are to be set to the corresponding values from this attribute object. The symbols PTHREAD_INHERIT_SCHED and PTHREAD_EXPLICIT_SCHED are defined in the header <pthread.h>. If successful, the pthread_attr_setinheritsched() and pthread_attr_getinheritsched() functions return 0. Otherwise, an error number is returned to indicate the error. The pthread_attr_setinheritsched() or pthread_attr_getinheritsched() functions may fail if: EINVAL attr or inheritsched is invalid. USAGE
After these attributes have been set, a thread can be created with the specified attributes using pthread_create(). Using these routines does not affect the current running thread. See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ pthread_attr_getschedparam(3C), pthread_attr_init(3C), pthread_attr_setscope(3C), pthread_attr_setschedpolicy(3C), pthread_create(3C), pthread_setschedparam(3C), attributes(5), standards(5) 23 Mar 2005 pthread_attr_getinheritsched(3C)
All times are GMT -4. The time now is 09:35 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy