[Haskell-beginners] Use mysql-simple (OS X and dymanic library trouble)

Brandon Allbery allbery.b at gmail.com
Sat Oct 25 13:43:12 UTC 2014


On Sat, Oct 25, 2014 at 8:07 AM, Christian Sperandio <
christian.sperandio at gmail.com> wrote:

> After, to link the mysql-simple package I did an export
> LD_LIBRARY_PATH=/usr/local/mysql-5.6.11-osx10.7-x86_64/lib. Thus, the
> library libmysqlclient.18.dylib was found.
>

This is usually a bad idea, and what you're seeing is the least of the
things that can go wrong.

The correct fix for all of this is not to use the environment settings, but
to build the mysql binding with

    cabal install mysql-simple
--extra-lib-dirs=/usr/local/mysql-5.6.11-osx10.7-x86_64/lib

so it actually finds and records the location of the library instead of
using an unsafe override that you have to reproduce at runtime (doing that
for anything launched from the GUI is difficult, and in some OS X releases
impossible, and is always risky).

-- 
brandon s allbery kf8nh                               sine nomine associates
allbery.b at gmail.com                                  ballbery at sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20141025/661f7fa0/attachment.html>


More information about the Beginners mailing list