Help wanted


 
Thread Tools Search this Thread
Top Forums Programming Help wanted
# 1  
Old 07-24-2001
Threads in Unix

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

Last edited by reddyb; 07-25-2001 at 10:44 AM..
# 2  
Old 08-18-2001
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.
# 3  
Old 08-26-2001
threads programming

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".
# 4  
Old 08-28-2001
c programming in unix environment

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

.
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. What is on Your Mind?

Just wanted to say thanks!!!

Greetings all!! Have only recently signed up to this forum and I must say I am thoroughly impressed! :D Everyone has been nothing but amazingly helpful and I haven't been made to feel like the newbie that I am. I will definately be becoming a daily user of this site not only for help... (1 Reply)
Discussion started by: U_C_Dispatj
1 Replies

2. Programming

Minix help wanted

Hi to all, i am trying to make a kernel call that will display the number of times each kernel call was called. Any idea where to look? I can't find the right files and also how to get all those values. Already made a kernel call that displays how many kernel calls are in the system. I am using... (6 Replies)
Discussion started by: hariscy
6 Replies

3. SCO

N1 sco unix R3.2 V4.2 WANTED!!

Hi guys!!! i have a sco unix 3.2 v4.2 floppy's but i don't have N1 boot disk!! how to find it??? :confused: thanks!! (sorry for my bad english!) (4 Replies)
Discussion started by: panos_pit
4 Replies

4. Shell Programming and Scripting

help wanted to understand MQ script

hi , i am writing a script to copy the MQ messages from onw queue to another. The following i got from one site, but i di not understand , can anyone explain. /root/scripts/sap/q -m$Q_MANAGER -i$Q_NAME_SRC_1 -F/logs/mq/MQ_COPYdump_$Q_NAME_SRC_1.$$ /root/scripts/sap/q -m$Q_MANAGER... (0 Replies)
Discussion started by: Satyak
0 Replies

5. UNIX for Advanced & Expert Users

help wanted kernel avi

Hello there! Slightly off topic maybe, but maybe someone can help us. For a videoshow which will be called reality 6.1 we need a video file from a unix kernel that is compiling. Does anyone know how to capture this, or does anyone have such a vid? cheers, iuno (www.iuno.nl) (2 Replies)
Discussion started by: iuno
2 Replies

6. UNIX for Dummies Questions & Answers

Suggestions wanted ...

All, Have an AMD-K6/2 PC, 20G.Hd along with RH7.2. Wanting to know what I should do in terms of setup (workstation/server) and then what I can do with it? I'd like to learn a DBMS and SQL - can I do this using RedHat? Any suggestions with how I can use/ what I can do with this appreciated. (3 Replies)
Discussion started by: Cameron
3 Replies

7. UNIX for Advanced & Expert Users

WANTED: Load Generator

Hi, someone knows about a Load Generator for web?, I´ve been searching the web and I found "Astra Test", but I doesn´t work. Thanks! :) (3 Replies)
Discussion started by: momo
3 Replies
Login or Register to Ask a Question