Re: Woody: pthread_rwlock_t error
On Wed, Sep 18, 2002 at 05:03:01PM +0200, Holger Rauch wrote:
> Why does the following simple test program
>
> #include <pthread.h>
>
> pthread_rwlock_t lock;
>
> int main( int argc, char** argv )
> {
> return(0);
> }
>
> yield these errors:
>
> thread_test.c:3: parse error before `lock'
> thread_test.c:3: warning: data definition has no type or storage class
>
> and what can I do to fix them?
pthread_rwlock_t is defined in SUSv2, so you need at least:
#define _XOPEN_SOURCE 500
... at the top of your file to access it. See 'info libc "Feature Test
Macros"'.
Cheers,
--
Colin Watson [cjwatson@flatline.org.uk]
Reply to: