Page 1 of 1

[Linux] Check for libraries under /usr/lib/x86_64-linux-gnu/

Posted: Sun Feb 12, 2023 5:32 pm
by winnylinny
There is a common issue with XnViewMP on Linux in which it does not correctly detect HEIF / HEIC support.

See this forum thread for reference (and a temporary solution that users can use in the meantime):
viewtopic.php?p=184814#p184814


This problem can be alleviated if XnViewMP also checks under /usr/lib/x86_64-linux-gnu/

Distros that assume pure 64-bit ecosystems will save their libraries directly under /usr/lib/, which is expected from installed software.

However, other distros (such as Ubuntu) will split certain library files into 32-bit and 64-bit specific directories.

If XnViewMP also checks under /usr/lib/x86_64-linux-gnu/, then it will correctly find and load the HEIF library for users of Ubuntu and Ubuntu-based related distros. :)

Re: [Linux] Check for libraries under /usr/lib/x86_64-linux-gnu/

Posted: Sun Feb 12, 2023 5:38 pm
by winnylinny
I just realized this might introduce a new problem, for example if it finds the same library file in two different locations.

Perhaps XnViewMP can "prioritize" where it finds library files? (Maybe it already does this?)

For example:
  1. First check under XnViewMP's own folders
  2. Then check under /usr/lib/
  3. Then check under /usr/lib/x86_64-linux-gnu/
I believe XnViewMP already does this. So all you will need to do is add another path: /usr/lib/x86_64-linux-gnu/

Re: [Linux] Check for libraries under /usr/lib/x86_64-linux-gnu/

Posted: Mon Feb 13, 2023 11:09 am
by xnview
perhaps by changing LD_LIBRARY_PATH

Re: [Linux] Check for libraries under /usr/lib/x86_64-linux-gnu/

Posted: Sun Jul 30, 2023 4:52 pm
by ani-avif
.so loading is controlled by /etc/ld.so.conf.d/, which already has x86_64-linux-gnu.conf with the following content:

Code: Select all

# Multiarch support
/usr/local/lib/x86_64-linux-gnu
/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu
HEIF fails because x86_64-linux-gnu has no libheif.so in it. The following fixed the problem on machine; no symlinks in /usr/lib were necessary:

Code: Select all

sudo ln -s /usr/lib/x86_64-linux-gnu/libheif.so.1 /usr/lib/x86_64-linux-gnu/libheif.so
Maybe XnView should link to libheif.so.1, not libheif.so?