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 / February 2004



Tip: Looking for answers? Try searching our database.

project using BSD Headers and libs?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Vin - 12 Jan 2004 15:26 GMT
Hi,

I have a need to use pthreads in a CW 8.3 bundle I am creating, but I
cannot find where the docs are to tell me what headers and libs I need
to include.

Can someone point me to where I can locate this information?

Thanks
Kirk Haderlie - 12 Jan 2004 17:02 GMT
All you need to include is <pthreads.h>.  This assumes that you have
/usr/include on your system include path.  If you are using the MSL you will
encounter some header conflicts that you will need to resolve.  If you have
more specific questions I would be happy to answer them.

> Hi,
>
[quoted text clipped - 5 lines]
>
> Thanks
MW Ron - 12 Jan 2004 17:08 GMT
>Hi,
>
[quoted text clipped - 3 lines]
>
>Can someone point me to where I can locate this information?

If you want to use pthreads, you'll need to go BSD all the way with CW
8.3.

the release notes show how to do this but off the top of my head...

In the access path move the MSL access path below the /include and /lib
and the Mac OS X folders so it is lower in the access paths.

Change your precompiled header so it is the version without MSL in it..
i.e.  instead of MSL MacHeadersMach-O.h it  would be just
MacHeadersMach-O.h

For the libraries change from using MSL_All library to  
MSL_Runtime_Mach-O.a (and if you are using MSL C++ the MSL_C++_Mach-O.a
should be added.  

Ron

Signature

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

Sean McBride - 12 Jan 2004 20:17 GMT
> I have a need to use pthreads in a CW 8.3 bundle I am creating, but I
> cannot find where the docs are to tell me what headers and libs I need
> to include.

The release notes talk about using the BSD headers, take a look at that.
Vin - 14 Jan 2004 15:36 GMT
Thanks for the info.

I've searched the release notes section and come across some
references to BSD headers/libs in projects, but I am not certain if
they are what I need.

Possibly I don't have them installed?  Is there a specific filename
for release note that you  are mentioning?

Thanks

> > I have a need to use pthreads in a CW 8.3 bundle I am creating, but I
> > cannot find where the docs are to tell me what headers and libs I need
> > to include.
>
> The release notes talk about using the BSD headers, take a look at that.
MW Ron - 14 Jan 2004 16:38 GMT
>Thanks for the info.
>
[quoted text clipped - 4 lines]
>Possibly I don't have them installed?  Is there a specific filename
>for release note that you  are mentioning?

If you have the XCode Tools (or Apple Developers Tools for OS X 10.0 -
10.2) then you have them isntalled.  If you don't have the Developer
tools installed you can't debug with CW or make Mach-O applications.

Basically if your search path searches for /usr/lib and usr/include
before searching for MSL it uses BSD.   If it searches and FINDS the MSL
folder before it searchs the  /usr/lib and usr/include  then it uses MSL
instead and in practice should use BSD for anything not included in MSL.

The only problem happens when you have something such as pthreads that
are declared in a standard header.   such as stdio.h    this was more a
problem in 8.3 than in CW 9.

Ron

>> > I have a need to use pthreads in a CW 8.3 bundle I am creating, but I
>> > cannot find where the docs are to tell me what headers and libs I need
>> > to include.
>>
>> The release notes talk about using the BSD headers, take a look at that.

Signature

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

Eric Schneck - 03 Feb 2004 07:11 GMT
>>Thanks for the info.
>>
[quoted text clipped - 25 lines]
>>>
>>>The release notes talk about using the BSD headers, take a look at that.

Pardon my butting in, but...

I am using CW 7.2 on Panther. I am trying to use BSD socket calls in my
code. I tried to add MSL_Runtime_Mach-O.a to the library list for my
project as mentioned in this thread, but the file is greyed out in the
"Add files to Project" dialog.
How can I add this file, or is it not compatible with 7.2, or is there
another way to get the accept/bind/listen functions linked in?

Eric
MW Ron - 03 Feb 2004 17:27 GMT
>Pardon my butting in, but...
>
>I am using CW 7.2 on Panther.

All bets are off,  I can not recommend that and Metrowerks does not
support CW 7 running on an Operating System that is two generations
newer than what it was developed and released on.   We are good but not
psychic :)

I am trying to use BSD socket calls in my
>code. I tried to add MSL_Runtime_Mach-O.a to the library list for my
>project as mentioned in this thread, but the file is greyed out in the
>"Add files to Project" dialog.

It is often that way when the file is already in your project.  Be sure
it isn't added already.   it will aslo be greyed out if you have the
wrong type.   The other reason would be if it was a PEF program and not
Mach-O program

>How can I add this file, or is it not compatible with 7.2, or is there
>another way to get the accept/bind/listen functions linked in?

If you are doing Mach-O  it should be allowed.  I don't believe we had
MSL C and it was Apple's linker ported to our tools with CW 7 Mach-O  so
this all should work, no extra needs for BSD.

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.