Re: Metrowerks CW and BSD on 10.x
Re: Metrowerks CW and BSD on 10.x
- Subject: Re: Metrowerks CW and BSD on 10.x
- From: "Thomas G. Schaffernoth" <email@hidden>
- Date: Thu, 20 Nov 2003 20:54:38 -0800
On 11/20/03 8:17 PM, "Pranav Kumar Sahu" <email@hidden> wrote:
>
Framework Tab will be there where your File, Link Order or Target Tabs are
>
there. If it's not there, it means you are creating a CFM application. So to
>
use a framework in CFM application you need to load it as bundles. Can refer
>
to CW Examples/Call CFM to Mach-O Framework.
>
>
--Pranav Sahu
Hey Pranav,
Thanks for the info, so I take it that for every function that I call for
BSD that is in the framework, I have to do the following:
1. Setup the system framework via the following call from the example,
changing Carbon to System.
/* Create a bundle reference based on its name */
theErr = CreateFrameworkBundleFromName(CFSTR("Carbon.framework"),
&theBundle);
2. Get a pointer to the function from the framework, each unique function
call has to have a function pointer gained by the following:
/* Lookup the function in the bundle by name */
theNoteAlertPtr = (void *)
CFBundleGetFunctionPointerForName(theBundle, CFSTR("NoteAlert"));
So for my case of wanting to get a BSD socket "connect" would be the
following:
/* Create a bundle reference based on its name */
theErr = CreateFrameworkBundleFromName(CFSTR("System.framework"),
&theBundle);
theNoteAlertPtr = (void *)
CFBundleGetFunctionPointerForName(theBundle, CFSTR("connect"));
Ultimately, I am converting an OT implementation in a Palm Conduit to BSD
sockets for 10.x because of OT's issues on 10.x. That is why I have the CFM
constraint. Creating the OT Palm conduit was my first exposure to the Mac
9.x and 10.x, learning a lot...
Thanks for your help.
Tom
>
>
-----Original Message-----
>
From: Thomas G. Schaffernoth [mailto:email@hidden]
>
Sent: Friday, November 21, 2003 9:55 AM
>
To: Pranav Kumar Sahu
>
Cc: email@hidden
>
Subject: Re: Metrowerks CW and BSD on 10.x
>
>
>
On 11/20/03 7:35 PM, "Pranav Kumar Sahu" <email@hidden> wrote:
>
>
> You don't have to add an Library. To your framework tab in CW project add
>
> system.framework. That will take care of these thing.
>
>
>
> --Pranav Sahu
>
>
Sorry that I didn't mention it, but I have CW 8.3. There is no framework
>
tab in 8.3 for the project. Should I add it to the access paths in 8.3?
>
>
Thanks.
>
Tom
>
>
>
>
>
> -----Original Message-----
>
> From: Thomas G. Schaffernoth [mailto:email@hidden]
>
> Sent: Friday, November 21, 2003 7:02 AM
>
> To: email@hidden
>
> Subject: Metrowerks CW and BSD on 10.x
>
>
>
>
>
> Hey Folks,
>
>
>
> Quick question, where are the libs BSD sockets on 10.x to link into a
>
> MetroWerks CW project that resolves:
>
>
>
> 1. freeaddrinfo
>
> 2. getaddrinfo
>
> 3. pthread_join
>
> 4. accept
>
> 5. getsockopt
>
> 6. select
>
> 7. connect...
>
>
>
> I took the SocketCancel example, built it and ran it in Project Builder
>
> fine. I am trying to get the same code to build and run in CW. It is not
>
> obvious to me in Project Builder where these libs are that get linked in
>
to
>
> handle the BSD calls.
>
>
>
> I tried to add the file:
>
>
>
> /usr/lib/libBSDPClient.A.dylib
>
>
>
> To the CW project, but it will not allow me. It does not recognize the
>
file
>
> as having an attribute that allows it to be added. The file is grayed out
>
> in the dialog box list.
>
>
>
> Thanks.
>
> Tom
>
> _______________________________________________
>
> macnetworkprog mailing list | email@hidden
>
> Help/Unsubscribe/Archives:
>
> http://www.lists.apple.com/mailman/listinfo/macnetworkprog
>
> Do not post admin requests to the list. They will be ignored.
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.