Re: How to use C API under MAC OSX ?
Posted by: Bruce Martin
Date: October 22, 2005 02:34PM

I have a client working it is written as a bundle using Apple's xCode. The problem I have is I can't get it to include the MySQL libs when I compile it so no one else can use it. How can I do that?

BTW, To get it to work for me I had to include the libmysqlclient.a in the xCode interface. Also if you are using xCode and any of the core foundation functions you need to convert a CFStringRef to a C string and back again. I used:

CFStringRef myConvertedString = CFStringCreateWithCString(NULL,<The C string >,kCFStringEncodingMacRoman);

And to go from a CFStringRef to a C string use:

char* getCStr(CFStringRef myString){
//Modified by Bruce Martin to simplify!
int bufferSize = CFStringGetLength(myString)+1;
char *cString = malloc(bufferSize);
CFStringGetCString(myString,cString,bufferSize,kCFStringEncodingMacRoman);
return cString;
}

Again, if you can help me with my problems I would appreciate it.

Options: ReplyQuote


Subject
Views
Written By
Posted
389
September 14, 2005 02:49PM
Re: How to use C API under MAC OSX ?
431
October 22, 2005 02:34PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.