build error using hsqml

Hello, I'm trying to build a program using HsQml. cabal 1.14.0 fails with this error: Building HsQmlTest-0.0.1... Preprocessing executable 'HsQmlTest' for HsQmlTest-0.0.1... [1 of 1] Compiling Main ( src/Main.hs, dist/build/HsQmlTest/HsQmlTest-tmp/Main.o ) Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. Loading package array-0.4.0.0 ... linking ... done. Loading package deepseq-1.3.0.0 ... linking ... done. Loading package containers-0.4.2.1 ... linking ... done. Loading package filepath-1.3.0.0 ... linking ... done. Loading package tagged-0.4.2.1 ... linking ... done. Loading package bytestring-0.9.2.1 ... linking ... done. Loading package text-0.11.2.0 ... linking ... done. Loading package transformers-0.3.0.0 ... linking ... done. <command line>: can't load .so/.DLL for: /home/fabien/.cabal/lib/hsqml-0.3.4.0/ghc-7.4.1/libcbits-hsqml-0.3.4.0.so (libQt5Widgets.so.5: cannot open shared object file: No such file or directory) Loading package hsqml-0.3.4.0 ... Using --extra-lib-dirs to set the path of the library does not improve the situation. Here is the cabal description: name: HsQmlTest version: 0.0.1 cabal-version: >=1.2 build-type: Simple license: AllRightsReserved license-file: "" description: data-dir: "" executable HsQmlTest build-depends: QuickCheck -any, base -any, hsqml -any, text -any main-is: Main.hs buildable: True cpp-options: -DMAIN_FUNCTION=exeMain extra-lib-dirs: /media/travail/debian-sources/qt5/qtbase/lib/ hs-source-dirs: src Any hint ? -- Fabien

On Sat, 26 Mar 2016 19:15:07 +0100
Fabien R
Any hint ?
You're missing the .so file:
<command line>: can't load .so/.DLL for: /home/fabien/.cabal/lib/hsqml-0.3.4.0/ghc-7.4.1/libcbits-hsqml-0.3.4.0.so (libQt5Widgets.so.5: cannot open shared object file: No such file or directory) Loading package hsqml-0.3.4.0 ...
On debian-based distributions you may use apt-file to find which package(s) contain files, e.g. (on jessie): % apt-file find libQt5Widgets.so libqt5widgets5: /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5 ... qtbase5-dev: /usr/lib/x86_64-linux-gnu/libQt5Widgets.so These paths ought to be searched by default, so I suggest you're just missing the package. Best, Max

On 26/03/2016 19:35, Max Voit wrote:
On debian-based distributions you may use apt-file to find which package(s) contain files, e.g. (on jessie):
% apt-file find libQt5Widgets.so libqt5widgets5: /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5 I compiled Qt5 from sources. This file is in /media/travail/debian-sources/qt5/qtbase/lib/ . Is the path correctly set in the cabal description file ?
-- Fabien

Dear Fabien, On Sun, Mar 27, 2016, at 09:49 AM, Fabien R wrote:
I compiled Qt5 from sources. This file is in /media/travail/debian-sources/qt5/qtbase/lib/ . Is the path correctly set in the cabal description file ?
I think your problem is that pointing the compiler to your local Qt libraries at build time does not necessarily mean that the dynamic linker can find them at run time. Most expediently, try adding the your local lib directory to the LD_LIBRARY_PATH environment variable. You can bake the runtime search path into your executable by passing the -rpath flag to the linker. I suppose that, since your Qt install location isn't on the system global library search path, strictly speaking its pkg-config files should contain the correct -rpath flags so that everything links correctly at runtime. Perhaps Qt's build can be configured to do that. Regards, -- Robin KAY http://www.gekkou.co.uk/

On 27/03/16 15:23, Robin KAY wrote:
Dear Fabien,
I think your problem is that pointing the compiler to your local Qt libraries at build time does not necessarily mean that the dynamic linker can find them at run time. Most expediently, try adding the your local lib directory to the LD_LIBRARY_PATH environment variable.
Thanks Robin, Updating LD_LIBRARY_PATH did the trick. -- Fabien
participants (3)
-
Fabien R
-
Max Voit
-
Robin KAY