![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| hi probs with rm command | madhu_aqua14 | UNIX for Dummies Questions & Answers | 13 | 03-05-2007 04:58 AM |
| lpthread error when trying to compile static BIND | MixmasterMike | UNIX for Advanced & Expert Users | 0 | 07-25-2005 08:25 PM |
| More SSH probs ... | frustrated1 | SUN Solaris | 2 | 06-17-2005 05:18 AM |
| copy probs | svennie | UNIX for Dummies Questions & Answers | 12 | 11-18-2004 06:53 AM |
| probs compiling lex | sinner | Shell Programming and Scripting | 0 | 04-13-2004 11:50 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
probs compiling with gcc + lpthread
Im trying to write a program atm which uses mutexes to control thread access to a certain code section ( the critical section).
However, whenever I compile the code using gcc I get the following message from gcc Unresolved text symbol "pthread_mutex_lock" Unresolved text symbol "pthread_mutex_unlock" I initalise my mutex as follows, after including <pthread.h> in my code Code:
pthread_mutex_init(&cs_mutex,NULL); Code:
pthread_mutex_lock(&cs_mutex); /* Do critical section stuff here */ pthread_mutex_unlock(&cs_mutex); I have included the -lpthread (which is needed to support thread functionality in the program ) in the compiling command, so I cannot understand why my code is not compiling Last edited by JamesGoh; 03-02-2008 at 09:01 PM. |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Hi guys
I found out what the problem was I mis-spelt thread as thead (slaps himself over the head) in pthread_mutex_lock and pthread_mutex_unlock which was why the compiler couldn't identify it :P ohh the joys of spelling mistakes cheers |
|||
| Google The UNIX and Linux Forums |