Advertisement

waitpid and g++

Started by May 19, 2004 05:38 AM
5 comments, last by Sir Valeq 20 years, 5 months ago
Hi! Do you have any idea why ''waitpid'' is an undeclared identifier when I compile a *.cpp file with g++ and it compiles fine when there''s a *.c file and gcc? Are there any special includes for c++ to get waitpid working? Thanks -------------- "We cannot all be masters." - William Shakespeare
--------------"We cannot all be masters." - William Shakespeare
Usually a man ''call name'' will return the necessary includes.

OS X man waitpid:

#include <sys/types.h>
#include <sys/wait.h>

If you check that and it still doesn''t work...hrms....

Int.
Advertisement
ONLY if you get undefined symbols after doing the above, then enclose those includes in extern "C"

but most headers should do this automatically.
Hehe, of course, I did include those headers.
Now I''ll try with extern "C".
I hope it''ll help.
Thanks

--------------
"We cannot all be masters." - William Shakespeare
--------------"We cannot all be masters." - William Shakespeare
quote: Original post by Sir Valeq
I hope it''ll help.

Actually, given what you''ve said, it shouldn''t. You have a compile time error (undeclared identifier) mine fixes a link time error (undefined symbol)
Then what should I do? Use a different compiler? Which one?

--------------
"We cannot all be masters." - William Shakespeare
--------------"We cannot all be masters." - William Shakespeare
Advertisement
reduce it to a small 10 line .cc file that gets you the error, and show us that file ,adn the exact error (heck, all the compiler output) for that smaller file.

This topic is closed to new replies.

Advertisement