Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / CodeWarrior / January 2004



Tip: Looking for answers? Try searching our database.

How to locate std lib I need

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Moncef Mezghani - 13 Jan 2004 16:05 GMT
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.

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.

Thank you very muct for your help.
Moncef.
MW Ron - 14 Jan 2004 15:07 GMT
>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>

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.