Using X11 for an older program

Bill Cole macportsusers-20171215 at
Tue Dec 22 13:39:03 UTC 2020

On 21 Dec 2020, at 22:01, Michael wrote:

> OK. Next question: Is there any reason I cannot install libpng version 
> 15 at the sametime?

Not really. Better to update the software that wants it to use a current 

But the 1.5.x source is in the libpng site at Sourceforge, so you can 
still get it, build it, and install the libraries where you need them 
(/opt/X11/lib/)without affecting the v1.6.x version that MacPorts 

> I am aware that there is a non-versioned link file, that the latest 
> version of the dynamic library installs. That can stay at 16 where it 
> belongs. I mean specifically having both the libpng15 and the libpng16 
> files.
> I am very surprised at linking to a specific version of a dynamic 
> library. This is actually commercial software, and it did not link to 
> generic "libpng", nor to generic "libpng15" -- linking to a specific 
> version of a dynamic library? Isn't the whole point of dynamic 
> libraries that you don't get a single specific buggy version, but the 
> latest non-buggy version?

Yes and no. Versioned libraries exist because sometimes you really don't 
want to link to anything but the version that you built against. 
Sometimes interfaces change between versions, particularly "major" 
version changes such as in this case, and software using the library may 
be known to not be forward-compatible.

Also see below...

> On 2020-12-21, at 6:55 PM, Ken Cunningham 
> <ken.cunningham.webuse at> wrote:
>>> On 2020-12-21, at 10:55 AM, Michael <keybounce at> wrote: 
>>> > This should be a simple one. I hope.
>>>> I just installed a program that was compiled against the release 
>>>> version of mac's X11. Crashes on startup with this:
>>>> dyld: launch, loading dependent libraries
>>>> Dyld Error Message:
>>>> Library not loaded: /opt/X11/lib/libpng15.15.dylib
>>>> What symbolic links do I need? /opt has no X11 directory.

That's a bad sign, and a hint that you need to do more than just install 
the right version of libpng.

The /opt/X11/ tree is where the "XQuartz" implementation of X11 installs 
itself, along with a whole universe of its own required libraries. It 
includes (in the last version, 2.7.11) 4 versions of libpng, with a 
symlink for the unversioned name to libpng16.16.dylib. This implies 
something of a mess in how the various binaries in the XQuartz package 
were built, but you cannot fix that. You have a pre-built commercial 
package that specifies at least one older version of a library as 
installed by XQuartz so you can expect that it will also be dependent on 
the whole collection of libraries installed by XQuartz.

If you lack /opt/X11/, you do not have XQuartz installed. Apple has not 
included ANY X implementation in recent macOS versions, so you will need 
to install XQuartz if you can't get a version of the failing software 
built to use the X implementation that is installed by MacPorts.

Bill Cole
bill at or billcole at
(AKA @grumpybozo and many * addresses)
Not Currently Available For Hire

More information about the macports-users mailing list