Recent

Author Topic: Specify the path to libQt5Pas on Linux  (Read 537 times)

iruanpan

  • New member
  • *
  • Posts: 7
Specify the path to libQt5Pas on Linux
« on: October 22, 2022, 01:47:23 am »
I'm using trunk laz and trunk fpc

I hope to put the SO file of libQt5Pas in the same directory as the compiled application, so that the user does not need to manually install the ibQt5Pas of the trunk branch.

But i got this: error while loading shared libraries: libQt5Pas.so.1: cannot open shared object file: No such file or directory

I want my program to be directly executed like fpcupdeluxe-x86_64-linux-qt5.zip in fpcupdeluxe release

Hope someone can tell me how to do it, thanks

dbannon

  • Hero Member
  • *****
  • Posts: 2280
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Specify the path to libQt5Pas on Linux
« Reply #1 on: October 22, 2022, 03:55:51 am »
I am assuming Linux or another Unix here.
Linux apps do not look in the applications directory for libraries. On every distro, there is a list of defined places where the library is looked for so, it needs to be 'installed' into one of those places.

For example, on my Ubuntu system, they are in -
Code: [Select]
/usr/lib/x86_64-linux-gnu/libQt5Pas.so.1
/usr/lib/x86_64-linux-gnu/libQt5Pas.so.1.2.10

I am guessing that you are using a distribution that does not have a suitable libqt5pas in its repo ?

Davo
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

iruanpan

  • New member
  • *
  • Posts: 7
Re: Specify the path to libQt5Pas on Linux
« Reply #2 on: October 22, 2022, 06:14:22 am »
I am assuming Linux or another Unix here.
Linux apps do not look in the applications directory for libraries. On every distro, there is a list of defined places where the library is looked for so, it needs to be 'installed' into one of those places.

For example, on my Ubuntu system, they are in -
Code: [Select]
/usr/lib/x86_64-linux-gnu/libQt5Pas.so.1
/usr/lib/x86_64-linux-gnu/libQt5Pas.so.1.2.10

I am guessing that you are using a distribution that does not have a suitable libqt5pas in its repo ?

Davo

Yes, the distribution I'm using doesn't have a proper libQt5Pas installed directly in the repositories, so I'd like to know how to specify the path to look for SO files, like gcc's "-Wl,-rpath,"

dbannon

  • Hero Member
  • *****
  • Posts: 2280
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Specify the path to libQt5Pas on Linux
« Reply #3 on: October 22, 2022, 06:52:11 am »
I strongly suggest you don't go adding directories to the library path, thats a very Windows way to think. In Unix, libraries are shared and exist in agree places.

You can find debs and rpms that install libqt5pas and the dev library too at https://github.com/davidbannon/libqt5pas/releases

If you want/need to specifically build your own, maybe with some changes ? then look on your own system and see where similar libraries live. Put your new ones there too. The convention is for the build library to have its full name and version number and then symlink to name and simplified version number.

Sometimes, really obsessive sysadmins will give the built library a name like -
Code: [Select]
hand-built-libQt5Pas.so.1.2.10  -- actual binary
libQt5Pas.so.1.2.10             -- symlink to above
libQt5Pas.so.1                  -- symlink to above
libQt5Pas.so                    -- symlink to above

For my interest sake, just what distro are you using ?

EDIT : do not confuse run time paths to libraries with compile and link time paths to libraries.
 
Davo
« Last Edit: October 22, 2022, 06:57:31 am by dbannon »
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

zeljko

  • Hero Member
  • *****
  • Posts: 1381
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Specify the path to libQt5Pas on Linux
« Reply #4 on: October 22, 2022, 08:18:12 am »
I am assuming Linux or another Unix here.
Linux apps do not look in the applications directory for libraries. On every distro, there is a list of defined places where the library is looked for so, it needs to be 'installed' into one of those places.

For example, on my Ubuntu system, they are in -
Code: [Select]
/usr/lib/x86_64-linux-gnu/libQt5Pas.so.1
/usr/lib/x86_64-linux-gnu/libQt5Pas.so.1.2.10

I am guessing that you are using a distribution that does not have a suitable libqt5pas in its repo ?

Davo

Yes, the distribution I'm using doesn't have a proper libQt5Pas installed directly in the repositories, so I'd like to know how to specify the path to look for SO files, like gcc's "-Wl,-rpath,"

Add -rpath PATH in linker options of project pointing to your libqt5pas dir when deployed eg lib64/ subdir where your binary is copied

iruanpan

  • New member
  • *
  • Posts: 7
Re: Specify the path to libQt5Pas on Linux
« Reply #5 on: October 22, 2022, 12:27:55 pm »
I am assuming Linux or another Unix here.
Linux apps do not look in the applications directory for libraries. On every distro, there is a list of defined places where the library is looked for so, it needs to be 'installed' into one of those places.

For example, on my Ubuntu system, they are in -
Code: [Select]
/usr/lib/x86_64-linux-gnu/libQt5Pas.so.1
/usr/lib/x86_64-linux-gnu/libQt5Pas.so.1.2.10

I am guessing that you are using a distribution that does not have a suitable libqt5pas in its repo ?

Davo

Yes, the distribution I'm using doesn't have a proper libQt5Pas installed directly in the repositories, so I'd like to know how to specify the path to look for SO files, like gcc's "-Wl,-rpath,"

Add -rpath PATH in linker options of project pointing to your libqt5pas dir when deployed eg lib64/ subdir where your binary is copied

It works, thank you!

 

TinyPortal © 2005-2018