[Interest] how to link my own DBus lib build to Qt 6.4?

Alexey Edelev semlanik at gmail.com
Thu Nov 17 20:42:40 CET 2022


Hi,

You may try to override the system library using the LD_PRELOAD environment
variable. So ld will prefer to resolve the missing symbols from your
library but not the system one:
https://man7.org/linux/man-pages/man8/ld.so.8.html

Also IRRC, setting LD_LIBRARY_PATH to the directory containing the custom
library, may force using your library instead of the system one.

Regards,
Alexey.

чт, 17 нояб. 2022 г. в 20:19, Dennis Luehring <dl.soluz at gmx.net>:

> it works so far with m own Glib build but the dbus lib is always the
> systems one
>
> my steps
>
> build dbus
>
>    cd ~/qt6_dev
>    git clone https://github.com/freedesktop/dbus.git
>    cd dbus
>    git checkout dbus-1.14.4
>    cd ..
>    mkdir dbus-build
>    cd dbus-build
>    cmake ../dbus -DCMAKE_INSTALL_PREFIX=~/qt6_dev/dbus-install
>    cmake --build . --parallel 4
>    cmake --install .
>
> creates a dbus-1.pc pkgconfig in ~/qt6_dev/dbus-install/lib/pkgconfig
> and a libdbus-1.so, libdbus-1.so.3 etc in ~/qt6_dev/dbus-install/lib
>
> build qt
>
>    cd ~/qt6_dev
>    git clone git://code.qt.io/qt/qt5.git qt6
>    cd qt6
>    git checkout v6.4.0
>    perl init-repository
>    cd ..
>    mkdir qt6-build
>    cd qt6-build
>    PKG_CONFIG_PATH=~/qt6_dev/dbus-install/lib/pkgconfig
> ../qt6/qtbase/configure -debug -opensource -nomake examples -nomake
> tests -prefix ~/qt6_dev/qt6-install
>    cmake --build . --parallel 4
>    cmake --install .
>
> but libQt6DBus.so.6 still referes to the systems libdbus-1.so.3
>
> linux at linux-virtual-machine:~/qt6_dev/qt6-build$ ldd
> /home/linux/qt6_dev/qt6-build/lib/libQt6DBus.so.6
>    linux-vdso.so.1 (0x00007ffc965eb000)
>    libdbus-1.so.3 => /lib/x86_64-linux-gnu/libdbus-1.so.3
> (0x00007f43375bf000)
>    libQt6Core.so.6 => /home/linux/qt6_dev/qt6-build/lib/libQt6Core.so.6
> (0x00007f4336f1b000)
>    libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6
> (0x00007f4336cf1000)
>    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f4336ac9000)
>    ...
>
> works out of the box with Glib (only the PKG_CONFIG_PATH is different)
> it seems that my dbus pkgconfig seems to be ignored
>
> and raising the log-level doesn't give more information
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> https://lists.qt-project.org/listinfo/interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20221117/59e1a693/attachment.htm>


More information about the Interest mailing list