rockowitz / ddcui

Graphical user interface for ddcutil - control monitor settings
http://www.ddcutil.com
GNU General Public License v2.0
147 stars 2 forks source link

qmake: libddcutil.so.1 => not found #9

Open 532910 opened 4 years ago

532910 commented 4 years ago

qmake:

% ./ddcui 
./ddcui: error while loading shared libraries: libddcutil.so.1: cannot open shared object file: No such file or directory
% ldd ddcui | grep ddc
        libddcutil.so.1 => not found

cmake:

% ldd ddcui | grep ddc
        libddcutil.so.1 => /usr/local/lib/libddcutil.so.1 (0x00007f5d1c61b000)

Moreover, the whole shared object dependencies list differs: ddcui builded with cmake points to libXrandr.so.2, libXrender.so.1, libbsd.so.0, libdrm.so.2, librt.so.1, libudev.so.1, libusb-1.0.so.0 while ddcui builded with qmake doesn't.

rockowitz commented 4 years ago

On 9/19/19 2:16 AM, sergio wrote:

qmake:

|% ./ddcui ./ddcui: error while loading shared libraries: libddcutil.so.1: cannot open shared object file: No such file or directory | |% ldd ddcui | grep ddc libddcutil.so.1 => not found |

cmake:

|% ldd ddcui | grep ddc libddcutil.so.1 => /usr/local/lib/libddcutil.so.1 (0x00007f5d1c61b000)| It looks like you've used  'sudo make install' to install ddcutil, in which case (by default) libddcutil.so is stored in /usr/local/lib.  On some distributions, this directory is in the default library path, on others it is not.   (For a discussion of the how libraries are searched for, the manpage for ld.so.  Most relevant to us are the libraries specified in /etc/ld.so.conf.d.)

||It appears that CMakeLists.txt is handling this case, while ddcui.pro is not.  I'll look at this more closely, but for now try adding the following line to ddcui.pro:

LIBS += -L"/usr/local/lib"

Alternatively, add /usr/local/lib to environment variable LD_LIBRARY_PATH before invoking qmake.

Also what is the output of   pkg-check ddcutil --libs

To see the default library search path: |   d --verbose |grep SEARCH_DIR |tr -s ' ;'\012|

||

Moreover, the whole shared object dependencies list differs: ddcui builded with cmake points to |libXrandr.so.2|, |libXrender.so.1|, |libbsd.so.0|, |libdrm.so.2|, |librt.so.1|, |libudev.so.1|, |libusb-1.0.so.0| while ddcui builded with qmake doesn't.

libXrandr, libdrm, libudev, and libusb-1.0 are dependencies of libddcutil.  The remainder may be indirect dependencies of these, or they may be pulled in by the Qt libraries.   They shouldn't be pulled in, but no harm if they are (other than bloating the size of the executable).   I'll look into this as well.

I had initially been using qmake, but cmake is currently my primary build system.  I try to keep ddcui.pro in sync.

Thanks for pointing out these issues.

I look forward to your comments on the running GUI.   Please put them in a separate issue.  Let's leave this one for build problems.

Sanford

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/rockowitz/ddcui/issues/9?email_source=notifications&email_token=ADMGY3SUFYQVTP2VDUNYRWDQKMKLHA5CNFSM4IYG3Z5KYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HMKFZXA, or mute the thread https://github.com/notifications/unsubscribe-auth/ADMGY3S36S3XRGOCGSUI32TQKMKLHANCNFSM4IYG3Z5A.

532910 commented 4 years ago

It looks like you've used 'sudo make install' to install ddcutil, in which case (by default) libddcutil.so is stored in /usr/local/lib.

Yes!

With

LIBS += -L"/usr/local/lib"

in ddcui.pro it works fine.

There are no pkg-check in debian:

% apt-file search bin/pkg-check
# no output
% pkg-config ddcutil --libs
-L/usr/local/lib -lddcutil -lglib-2.0 -lXrandr -lX11
% pkg-config --variable pc_path pkg-config
/usr/local/lib/x86_64-linux-gnu/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig

After building with qmake with LIBS += -L"/usr/local/lib" added shared dependencies looks equal.

532910 commented 4 years ago

What comments on the running GUI you mean?

rockowitz commented 4 years ago

On 9/19/19 9:27 AM, sergio wrote:

It looks like you've used 'sudo make install' to install ddcutil, in
which case (by default) libddcutil.so is stored in /usr/local/lib.

Yes!

With

LIBS += -L"/usr/local/lib"

in |ddcui.pro| it works fine.

There are no |pkg-check| in debian:

Brain infarct.  For some reason I frequently mistype pkg-config as pkg-check.

% apt-file search bin/pkg-check # no output % pkg-config ddcutil --libs -L/usr/local/lib -lddcutil -lglib-2.0 -lXrandr -lX11 % pkg-config --variable pc_path pkg-config /usr/local/lib/x86_64-linux-gnu/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig

After building with qmake with |LIBS += -L"/usr/local/lib"| added shared dependencies looks equal.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/rockowitz/ddcui/issues/9?email_source=notifications&email_token=ADMGY3VAJW2MBY4ODG6WJBLQKN44RA5CNFSM4IYG3Z5KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7DOXWY#issuecomment-533130203, or mute the thread https://github.com/notifications/unsubscribe-auth/ADMGY3QG7SZYJJH466KUHO3QKN44RANCNFSM4IYG3Z5A.

rockowitz commented 4 years ago

On 9/19/19 9:28 AM, sergio wrote:

What comments on the running GUI you mean?

Is it intuitive?  Do you encounter problems/unexpected behavior using it?

Some known issues:

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/rockowitz/ddcui/issues/9?email_source=notifications&email_token=ADMGY3WFSUHYFI4XIDGBM2TQKN5BNA5CNFSM4IYG3Z5KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7DO4CQ#issuecomment-533130762, or mute the thread https://github.com/notifications/unsubscribe-auth/ADMGY3QHAE4XXUASXTVAUWLQKN5BNANCNFSM4IYG3Z5A.

rockowitz commented 4 years ago

Configuration file ddcui.pro has been extensively reworked in the new 0.0.6 release to better handle libddcutil related files that are installed in local directories. For an extended discussion of this issue, see Shared Library Configuration on www.ddcutil.com