Help wanted

Hi,
I know very little about C and Unix. I have written a program to use threads. The program needs to get some values from a very large database.
I wrote a simple program and compiled but got the following errors.....

cc mythread.c -lthread

"/usr/include/pthread.h", line 120: syntax error before or at: *
"/usr/include/pthread.h", line 121: function cannot return function or array
"/usr/include/pthread.h", line 121: syntax error before or at: void
"/usr/include/pthread.h", line 121: warning: syntax error: empty declaration
"/usr/include/pthread.h", line 123: syntax error before or at: void
"/usr/include/pthread.h", line 124: warning: function prototype parameters must
have types
"/usr/include/pthread.h", line 125: syntax error before or at: *
"/usr/include/pthread.h", line 126: syntax error before or at: *
"/usr/include/pthread.h", line 127: syntax error before or at: *
"/usr/include/pthread.h", line 128: syntax error before or at: *
"/usr/include/pthread.h", line 129: syntax error before or at: *
"/usr/include/pthread.h", line 131: syntax error before or at: *
"/usr/include/pthread.h", line 133: syntax error before or at: *
"/usr/include/pthread.h", line 134: syntax error before or at: *
"/usr/include/pthread.h", line 135: syntax error before or at: *
"/usr/include/pthread.h", line 136: syntax error before or at: *
"/usr/include/pthread.h", line 137: syntax error before or at: *
"/usr/include/pthread.h", line 137: function cannot return function or array
"/usr/include/pthread.h", line 137: syntax error before or at: )
"/usr/include/pthread.h", line 137: warning: syntax error: empty declaration
"/usr/include/pthread.h", line 138: cannot recover from previous errors

I am using DYNIX/ptx, v 4.5

YOur help will be highly appreciated

thanks
reddyb

Perhaps you are missing some other include files?

Might help to read the pthread.h files and see what the lines are asking for or what #defines exist in the files.

Hi,

If you are new to C and UNIX, threads programming
is probably going to be a bit complex. It is
in fact an advanced programming topic. You may
want to read up a bit more on this topic first.
I would recommend "Pthreads Programming" published
by O'Reilly or "Programming with POSIX Threads"
published by Addison-Wesley. Based on the errors
your getting, it looks like a problem with your
code if the first error you actually get is the
"syntax error" (even though it says it was
encountered in pthreads.h). It may help to
attach the source for "mythread.c".

so, here is the source you ben generated. please see the message 'parameters must
have types'. you haven't type down your 'line 121' for details. but let us just see the others more careful. visit the page below for more explaination.

cc mythread.c -lthread

"/usr/include/pthread.h", line 120: syntax error before or at: *
"/usr/include/pthread.h", line 121: function cannot return function or array
"/usr/include/pthread.h", line 121: syntax error before or at: void
"/usr/include/pthread.h", line 121: warning: syntax error: empty declaration
"/usr/include/pthread.h", line 123: syntax error before or at: void
"/usr/include/pthread.h", line 124: warning: function prototype parameters must
have types
"/usr/include/pthread.h", line 125: syntax error before or at: *
"/usr/include/pthread.h", line 126: syntax error before or at: *
"/usr/include/pthread.h", line 127: syntax error before or at: *
"/usr/include/pthread.h", line 128: syntax error before or at: *
"/usr/include/pthread.h", line 129: syntax error before or at: *
"/usr/include/pthread.h", line 131: syntax error before or at: *
"/usr/include/pthread.h", line 133: syntax error before or at: *
"/usr/include/pthread.h", line 134: syntax error before or at: *
"/usr/include/pthread.h", line 135: syntax error before or at: *
"/usr/include/pthread.h", line 136: syntax error before or at: *
"/usr/include/pthread.h", line 137: syntax error before or at: *
"/usr/include/pthread.h", line 137: function cannot return function or array
"/usr/include/pthread.h", line 137: syntax error before or at: )
"/usr/include/pthread.h", line 137: warning: syntax error: empty declaration
"/usr/include/pthread.h", line 138: cannot recover from previous errors

I am using DYNIX/ptx, v 4.5

.