Hi Everybody,

I am using Redhat Linux Release 9 (Shrike).

I am learning threaded programming and trying to compile an example program
listed at the end of this mail.
I get the following problem using the command gcc test.c

test.c:7: parameter `thread2' has just a forward declaration
test.c:6: parameter `thread1' has just a forward declaration
test.c:8: parse error before '=' token
test.c:13: parse error before '&' token
test.c:16: parse error before numeric constant
test.c:16: warning: data definition has no type or storage class

I don't know what I am doing wrong. Do I have to include something else?
I could find out that the definition for pthread_t was given in
bits/pthreadtype.h file and it was unsigned long int. But that is not helping
me.

If possible please respond directly to anandsr AT hss DOT hns DOT com.

thanks,
-anandsr

----------------------------------------------------------------------
#include
#include


int main (

pthread_t thread1;
pthread_t thread2;
char *message1 = "Hello";
char *message2 = "World";

pthread_create( &thread1, pthread_attr_default,
(void*)&print_message_function, (void*) message1);
pthread_create(&thread2, pthread_attr_default,
(void*)&print_message_function, (void*) message2);

exit(0);
}

void print_message_function( void *ptr )
{
char *message;
message = (char *) ptr;
printf("%s ", message);
}