>Hello,
>I had compiled on a PowerBook G4/ Mac OS X 10.3.2 a large C++ project
>with CW 8.3, and stop on some link errors : undefined function like:
>waitpid, fork, sleep, clock, asctime,.. witch are standard C function.
waitpid, fork, sleep are notANSI standard C functions but are POSIX and
should be included in the BSD C items
You might need to include the Kernel Framework to your target.
>The same project build with g++ version 3.3 is done properly.
>
>What lib files I need to add to my project to link properly?
>
>Actually I use MSL_C++Mach-O_D.a, and MSL_RuntimeMach-O_D.a.
It should pick up the BSD stuff automatically, be sure you have the
access paths set up correctly.... in the access paths order put the
usr/library and usr/include and Mac OS X Support folders ahead of the
MSL headers.
Be sure you use the correct precompiled header (without MSL in the name)
Oh one other thing not relevant to any processor is be sure you aren't
getting name mangling errors and such by mixing C and C++ files.
Use
#include <sys/types.h>
#include <sys/wait.h>
Ron

Signature
Metrowerks, maker of CodeWarrior - "Software Starts Here"
Ron Liechty - MWRon@metrowerks.com - <http://www.metrowerks.com>
Sean McBride - 15 Jan 2004 02:25 GMT
> waitpid, fork, sleep are notANSI standard C functions but are POSIX and
> should be included in the BSD C items
True.
> You might need to include the Kernel Framework to your target.
The Kernel framework is not for userland code, and should never be added
to any CW application project.
Moncef Mezghani - 16 Jan 2004 13:05 GMT
Hi Ron and many thanks for your responses.
> You might need to include the Kernel Framework to your target.
This is done.
> It should pick up the BSD stuff automatically, be sure you have the
> access paths set up correctly.... in the access paths order put the
> usr/library and usr/include and Mac OS X Support folders ahead of the
> MSL headers.
This is OK.
> Be sure you use the correct precompiled header (without MSL in the name)
This point may need to be more precised. I don't make choice on this
subject. Just used CW create project function, and before using these
specifics non ANSI functions, my project build correct.
> Oh one other thing not relevant to any processor is be sure you aren't
> getting name mangling errors and such by mixing C and C++ files.
>
> Use
> #include <sys/types.h>
> #include <sys/wait.h>
This is OK.
My thinking is that problem is caused by a missed library. Is-it true?
or is-it a header issue?
Moncef.
MW Ron - 16 Jan 2004 14:59 GMT
>Hi Ron and many thanks for your responses.
>
>> You might need to include the Kernel Framework to your target.
>
>This is done.
I see Eric said this was a no no.
>> It should pick up the BSD stuff automatically, be sure you have the
>> access paths set up correctly.... in the access paths order put the
[quoted text clipped - 19 lines]
>My thinking is that problem is caused by a missed library. Is-it true?
>or is-it a header issue?
If it is a compiler error it is a header issue or something
if it is a linker error it is either a missing library, source file,
name mangling or something of that sort.
Ron

Signature
Metrowerks, maker of CodeWarrior - "Software Starts Here"
Ron Liechty - MWRon@metrowerks.com - <http://www.metrowerks.com>