简体   繁体   中英

How to install MySQL Connector/C on Mac OS X?

I'm writing an app in C that requires MySQL interaction, so I downloaded the Connector/C archive from the official website, and it contains bin, lib and include folders, but I don't know where to install them. I could copy the include files into my project folder, but where can I put the lib file so that my compiled binary (and other binaries) can find it?

Thanks in advance!

This is confusing, isn't it.. don't know why they don't make this more clear.

The lib/ files go in /usr/local/lib The include/ files go in /usr/local/include The bin/ files go in /usr/local/bin

The /usr/.. directory isn't visible through finder afaik so you have to go at it via commandline. Best of luck

Also, in your Xcode project, make sure you add a Linked Library by going to your Target's settings, General, then adding Linked Library "libmysqlclient.dylib"

Alternatively, to do everything on the commandline by "mv", you could also execute (on cmdline):

defaults write com.apple.finder AppleShowAllFiles TRUE

and

killall Finder

to make the hidden folder /usr (and everything else) visible.

After placing your connector files (like Nektarios explicitly discribed where) and closing all "hidden folder - finder windows", execute on your cmd:

defaults write com.apple.finder AppleShowAllFiles FALSE

and again

killall Finder

to hide what have to be hidden.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM