[m-users.] Fwd: Beginner question: How to use an installed library
Dirk Ziegemeyer
dirk at ziegemeyer.de
Mon Sep 7 17:27:19 AEST 2015
Fyi - I forgot to set the m-users list in cc.
Julien had an idea that solved my problem.
Dirk
> Anfang der weitergeleiteten Nachricht:
>
> Von: Dirk Ziegemeyer <dirk at ziegemeyer.de>
> Betreff: Aw: [m-users.] Beginner question: How to use an installed library
> Datum: 5. September 2015 19:57:36 MESZ
> An: Julien Fischer <juliensf at gmail.com>
>
>
>> Am 05.09.2015 um 10:22 schrieb Julien Fischer <juliensf at gmail.com>:
>>
>> I have an idea of what my have happened here, namely that that the installation prefix was not set when
>> the .dylib file was generated and the install name burned into it. When you built the library did you do:
>>
>> $ make INSTALL_PREFIX=/foo/bar/baaz
>> $ make INSTALL_PREFIX=/foo/bar/baaz install
>
> No.
>
>> or
>>
>> $ make
>> $ make INSTALL_PREFIX=/foo/bar/baaz install
>>
>
> Yes.
>
>> The difference is that with the latter the install name for the .dylib file will be set to the default installation
>> directory even though it will be installed in /foo/bar/baaz by the install target. You can check this by running
>> 'otool -L' on the .dylib file and seeing what the install name for the dylib file itself is.
>
> Otool-output is:
> $ otool -L libmercury_csv.dylib
> libmercury_csv.dylib:
> /usr/local/mercury-rotd-2015-02-20/lib/mercury/lib/hlc.gc/libmercury_csv.dylib (compatibility version 0.0.0, current version 0.0.0)
> /usr/local/mercury-rotd-2015-02-20/lib/mercury/lib/hlc.gc/libmer_std.dylib (compatibility version 0.0.0, current version 0.0.0)
> /usr/local/mercury-rotd-2015-02-20/lib/mercury/lib/hlc.gc/libmer_rt.dylib (compatibility version 0.0.0, current version 0.0.0)
> /usr/local/mercury-rotd-2015-02-20/lib/mercury/lib/libgc.dylib (compatibility version 0.0.0, current version 0.0.0)
> /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)
>
>
> The issue is solved now after typing:
> $ make INSTALL_PREFIX=/foo/bar/baaz
> $ make INSTALL_PREFIX=/foo/bar/baaz install
>
>
> Otool now prints:
> $ otool -L libmercury_csv.dylib
> libmercury_csv.dylib:
> /Users/dirk/temp/mercury_csv/lib/mercury/lib/hlc.gc/libmercury_csv.dylib (compatibility version 0.0.0, current version 0.0.0)
> /usr/local/mercury-rotd-2015-02-20/lib/mercury/lib/hlc.gc/libmer_std.dylib (compatibility version 0.0.0, current version 0.0.0)
> /usr/local/mercury-rotd-2015-02-20/lib/mercury/lib/hlc.gc/libmer_rt.dylib (compatibility version 0.0.0, current version 0.0.0)
> /usr/local/mercury-rotd-2015-02-20/lib/mercury/lib/libgc.dylib (compatibility version 0.0.0, current version 0.0.0)
> /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)
>
> Thank you very much.
>
> Dirk
More information about the users
mailing list