Take the 2-minute tour ×

porting library from unix (COMPAQ Tru 64)DEC ALPHA to w32 XP sp3 OS. language: C code on unix platform built with c89 compiler with options: c89 -c -O -DLOWER_U -DSOLARIS sychld.c

Using MS Visual Studio 2010 C compiler only with /c (compile only) option

Getting error wait.h(79): C2061 syntax error identifier 'wait' code:

77:#ifndef _BSD             /* POSIX definition of wait() */
78:#ifdef _NO_PROTO
79:extern pid_t wait();
82:extern pid_t wait(int *);
84:#endif /* _NO_PROTO */
85:#endif /* _BSD */

Note the vars are declard in conditional statements. The var on line 79 is also declared on line 285.

284:#ifdef _NO_PROTO
285:extern pid_t wait();
286:extern pid_t wait3();
290:extern pid_t wait(union wait *);
291:#include <sys/resource.h>   /* contains rusage struct for wait3 */
292:extern pid_t wait3(union wait *, int, struct rusage *);
294#endif  /* !_NO_PROTO */

I am not a seasoned C programmer, but I feel if I create a temp var, then I would only make one declaration. How can I do this without impacting the integrity of the code?

Is this the reason I am getting the error???????

share|improve this question
add comment

1 Answer

Line 79 is not declaring a variable, it's declaring a function.

The actual problem the compiler is complaining about (even though the message is far from clear about it) is that it doesn't know what pid_t is.

Your bigger problem (if your code is using wait()) is that Windows doesn't support the Unix fork model of spawning processes - at least not without using something like the POSIX subsystem (which I'm not even sure if Windows supports anymore) or using the Cygwin library. I suspect that Cygwin might be your best bet for easily porting the application, but that's hard to know without more information about the app and whether the Cygwin licensing is acceptable.

share|improve this answer
I'm in the same boat with you! I do have Cygwin loaded, ...maybe that's a direction I should consider... –  user1720926 Oct 4 '12 at 19:16
I will contact the vendor. Thank you for your response. –  user1720926 Oct 4 '12 at 19:17
add comment

Your Answer


