Page 1 of 1

./configure --enable-static Not adding required libs? (Mac)

Posted: 19 Oct 2018 03:13
by UKSparkle
I have tried to compile OpenTTD (1.8.0) on my MacBook Pro Mojave and 'succeeded' using the following commands

./configure --enable-static
make -j8
make bundle

The game runs very well on my MacBook Pro (and I love the game very much! :bow: ) However, when I zip the bundle directory and copy the file to my iMac. It complains that the libs can not be found.
>
Dyld Error Message:
Library not loaded: /usr/local/lib/libfreetype.6.dylib
Referenced from: /User/<name>/Download/OpenTTD/OpenTTD.app/Contents/MacOS/openttd
Reason: image not found
>

Did I do something wrong? :o

Re: ./configure --enable-static Not adding required libs? (Mac)

Posted: 19 Oct 2018 04:13
by Eddi
i'm going to go on a limb here and assume that you didn't install the library on the other computer, and that's why it can't find it.

there's two solutions here:
  1. you can install said library (in the correct version)
  2. or you can compile a "static" build that already contains its own copy of the library (need to dig through ./configure options for that)

Re: ./configure --enable-static Not adding required libs? (Mac)

Posted: 19 Oct 2018 05:45
by andythenorth
You could try

Code: Select all

./configure --without-freetype
But I haven't actually tried that, so I don't know if it will help, sorry :)

This used to be necessary with some older OS X versions where there were issues with freetype.

Re: ./configure --enable-static Not adding required libs? (Mac)

Posted: 19 Oct 2018 10:35
by UKSparkle
Thank you for your response:

Eddi: I have tried the static option enabled (with results in a successful build but unable to run on other computers)

andythenorth: Out of interest, I tried "./configure --enable-static --without-freetype" and again, no luck.

Re: ./configure --enable-static Not adding required libs? (Mac)

Posted: 19 Oct 2018 11:00
by planetmaker
UKSparkle wrote:Thank you for your response:

Eddi: I have tried the static option enabled (with results in a successful build but unable to run on other computers)

andythenorth: Out of interest, I tried "./configure --enable-static --without-freetype" and again, no luck.
With the *same* error message as above - or is another library missing in that case?

Re: ./configure --enable-static Not adding required libs? (Mac)

Posted: 19 Oct 2018 12:12
by UKSparkle
Thank you for the continued support

Just complains about library missing

I would thought that the needed libraries would be copied to the bundle?

Re: ./configure --enable-static Not adding required libs? (Mac)

Posted: 21 Oct 2018 11:08
by Michi_cc
No, static means that the library code will be included in the app file itself, not that the normal lib will be copied.
For that to work the libraries itself also need to be present in a special static lib version. I guess that either configure picks the wrong lib file or that you don't have a static lib and the linker silently uses the dynamic lib anyway.

-- Michael Lutz