Welcome, Guest
Username: Password: Remember me
CodeTyphon Platforms (Win32/64, GTK2/3/4, QT4/5/6, Cocoa, FpGUI etc) Development, discussions and problems
  • Page:
  • 1

TOPIC:

Library error on QT5 Apps 3 years 7 months ago #15011

  • Cristian
  • Cristian's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 5
  • Thank you received: 0
Hi!
I've been using CodeTyphon for several months now, and it's amazing.

But I'm having this problem trying to make a QT5 application (first time).

It compiles without errors (not even warnings), but when i try to run it (I tested it on differents computers) I'm getting this error:

"error while loading shared libraries: libQt5Pas.so.1: cannot open shared object file: No such file or directory"

I read about it on some Lazarus Docs, but I'm still confused about what to do.

Can you give me a lead?

Thank you in advance

Please Log in or Create an account to join the conversation.

Library error on QT5 Apps 3 years 7 months ago #15012

  • Cristian
  • Cristian's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 5
  • Thank you received: 0
Well.. i found this:

github.com/davidbannon/libqt5pas/

And worked well. Except for CentOS, but im sure i will figure it out

Please Log in or Create an account to join the conversation.

Library error on QT5 Apps 3 years 7 months ago #15013

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4508
  • Thank you received: 1100
Thanks Sir

1)
QT4 and QT5 Libraries are C++ (Object C) libraries.
GTK2 and GTK3 are C (Procedure C) libraries.

2)
CodeTyphon can call/use direct "elements" ( procedures, functions etc) of C (Procedure C) libraries Win, GTK2, GT3 etc
CodeTyphon can NOT call/use direct "elements" ( procedures, functions etc) of C++ (Object C) libraries QT4 and QT5

3)
The solution to this problem is an "Interface Library"
--libQt4Pas.so for QT4
--libQt5Pas.so.1 for QT5

4)
These libraries have internal structure like C (Procedure C) libraries,
so, CodeTyphon (FPC part) can call/use direct "elements" from these Libraries.

5)
In normal case OSes or Distributions provide these libraries as part of QT4 or QT5 API
CodeTyphon has these libraries in directory
codetyphon/allzips/binqt/

6)
In Install/Build procedure, CT extract these libraries and make links to use from Host OS
--codetyphon/ScriptsLin/ln_Typhon1_QT4pas_Make_Links.sh
--codetyphon/ScriptsLin/ln_Typhon1_QT5pas_Make_Links.sh

7)
If Host OS of your application don't have libQt5Pas.so.1 library
you must install and make links for this library from directory above (5),
like CT script do in ScriptsLin/ln_Typhon1_QT5pas_Make_Links.sh
in your "OS Main Libraries" directory, /usr/lib/ for most Linux distributions.

8)
We build ALL libQt4Pas.so and libQt5Pas.so libraries with CTCenter
we write building info in 7zip file like qt5-x86_64-linux-readme.txt.

I hope to help you, with the QT4 and QT5 mystery... :)

PS: We never test the libraries in your link ,
and
we can't provide any WARRANTY that will work with CT QT platform applications...

..
PilotLogic Architect and Core Programmer

Please Log in or Create an account to join the conversation.

Last edit: by Matis A..

Library error on QT5 Apps 3 years 7 months ago #15015

  • Cristian
  • Cristian's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 5
  • Thank you received: 0
Hi, Sternas.
I really appreciate your response!
Before answer, i just want to say that I am a relatively amateur person, not only on CodeTyphon, but also as a programmer. So I'm sorrry if I ask dumb questions..

I checked the codetyphon/allzips/binqt/ folder, al 7z files where there.

After, i ran the n_Typhon1_QT5pas_Make_Links.sh script.
Here, I got this message:

"[ERROR] File /usr/local/codetyphon/qt5pas/x86_64-linux/libQt5Pas.so.1.2.9 NOT Exists...
[ERROR] Can't Make qt5pas links..."

So i tried with the ln_Typhon1_QT5pas_Install.sh script. This time, i got:

[INFO] Make qt5pas links to /usr/lib/x86_64-linux-gnu/ for x86_64-linux finish OK
[INFO] Make qt5pas links to /usr/lib/i386-linux-gnu/ for i386-linux finish OK

After that, i ran the _make_links again, and i got the same last output (OK).

so... i guessed that was it. I compiled my project again, successfully.. But on the clients machines it doesnt work. Same error as beginning:
"error while loading shared libraries: libQt5Pas.so.1: cannot open shared object file: No such file or directory"

Am I missing any step here?

Thank you again

Please Log in or Create an account to join the conversation.

Library error on QT5 Apps 3 years 7 months ago #15017

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4508
  • Thank you received: 1100
Sir
first of all, my suggestion is to start with Unix/Linux basics.

Extract from qt5-x86_64-linux.7z the libQt5Pas.so.1.2.9
Copy libQt5Pas.so.1.2.9 to TargetOS /usr/lib/ directory.


Open a terminal
and exec some Unix/Linux "kung fu" :)
su
cd /usr/lib
chmod 777 libQt5Pas.so.1.2.9

ln -f -s libQt5Pas.so.1.2.9 libQt5Pas.so.1.2
ln -f -s libQt5Pas.so.1.2.9 libQt5Pas.so.1
ln -f -s libQt5Pas.so.1.2.9 libQt5Pas.so

chmod 777 libQt5Pas.so.1.2
chmod 777 libQt5Pas.so.1
chmod 777 libQt5Pas.so

For ditribution without "su" like Ubuntu KDE use this Unix/Linux "kung fu"
cd /usr/lib
sudo chmod 777 libQt5Pas.so.1.2.9

sudo ln -f -s libQt5Pas.so.1.2.9 libQt5Pas.so.1.2
sudo ln -f -s libQt5Pas.so.1.2.9 libQt5Pas.so.1
sudo ln -f -s libQt5Pas.so.1.2.9 libQt5Pas.so

sudo chmod 777 libQt5Pas.so.1.2
sudo chmod 777 libQt5Pas.so.1
sudo chmod 777 libQt5Pas.so

And a question from our LAB programmers,
where do you install your Linux Application ?
PilotLogic Architect and Core Programmer

Please Log in or Create an account to join the conversation.

Library error on QT5 Apps 3 years 7 months ago #15019

  • Cristian
  • Cristian's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 5
  • Thank you received: 0
This is great!!
Well, let me tell you:

i tested it on several systems, and i will enumerate them here, and the result:
  • all the outputs refer at what i get when opening the program
  • the steps i enumerate are the actual order which I ran them




OpenSUSE 15.1

1)- Run "Kung Fu" on /usr/lib: Same error: "error while loading shared libraries: libQt5Pas.so.1: cannot open shared object file: No such file or directory"
2)- Run "Kung Fu" but on /usr/lib64 folder: different error: "/usr/lib64/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib64/libQt5Pas.so.1)"

3)- Just in case (i have no idea if i should or should not do this, but since this was all testing i took the liberty to try):
  • sudo zypper install qtct
  • sudo zypper install libqt5-* <-- this installed A LOT of packages
No changes



Centos 7.8

1)- Run "Kung Fu" on /usr/lib: Same error: "error while loading shared libraries: libQt5Pas.so.1: cannot open shared object file: No such file or directory"
2)- Run "Kung Fu" but on /usr/lib64 folder: New error!: "error while loading shared libraries: libQt5PrintSupport.so.5: cannot open shared object file: No such file or directory"

3)- Just in case:
  • yum install qt5-* <-- this installed A LOT of packages, and some of them actually helped.. because now i have tow brand new errors! : "/lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /lib64/libQt5Pas.so.1)" and "lib64/libQt5Core.so.5: version `Qt_5.11' not found (required by /lib64/libQt5Pas.so.1)"



Manjaro (ArchLinux)

1)- Run "Kung Fu" on /usr/lib: Working!! Just like that!



Ubuntu 20.04

1)- Run "Kung Fu" on /usr/lib: Error ".error while loading shared libraries: libQt5PrintSupport.so.5: cannot open shared object file: No such file or directory"
2)- Run "Kung Fu" but on /usr/lib64 folder: Same error

3)- Just in case:
  • sudo apt install qtct: Same error
  • sudo apt install libqt5pas1: WORKING <--- Why dont all distros have this?? It would be so much easier..



So.. as you can see.. Just using the libqt5pas.so file and the symlinks, i could only get ArchLinux working..
Ubuntu worked but maybe just by installing the "libqt5pas1" package would be enough.

OpenSUSE and CentOS.. No way..

Tell me: Im I missing some basics here?
The gtk2 version worked without issues on ALL of them

Please Log in or Create an account to join the conversation.

Library error on QT5 Apps 3 years 7 months ago #15021

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4508
  • Thank you received: 1100
"Tell me: Im I missing some basics here?"
YES
You must have QT5 API libraries to your Target OS

Go to CT directory
codetyphon/ScriptsLin/systems/

For Suse

Open for sample ln1_Install_SysLibraries_For_SuSE.sh
scroll down to "# Install libraries for QT5"
    sudo zypper --non-interactive install -y libQt5Core5
    sudo zypper --non-interactive install -y libQt5X11Extras5
    sudo zypper --non-interactive install -y libQt5PrintSupport5
    sudo zypper --non-interactive install -y libQt5Widgets5
    sudo zypper --non-interactive install -y libQt5WebKit5

Exec the above to your Target OS and then the "Kung Fu" :)

For CentOS

ln1_Install_SysLibraries_For_CentOS.sh
scroll down to "# Install libraries for QT5"
    sudo yum install -y qt5-qtbase
    sudo yum install -y qt5-qtbase-devel
    sudo yum install -y qt5-qtx11extras
    sudo yum install -y qt5-qtx11extras-devel

etc, etc



Linux has a lot of problems,
one of them: to many Packages Systems with deference packages names, a programming hell ...
For this reason many Commercial Applications Focus and target to 1, 2 Linux Distributions.


...
PilotLogic Architect and Core Programmer

Please Log in or Create an account to join the conversation.

Last edit: by Sternas Stefanos.

Library error on QT5 Apps 3 years 7 months ago #15022

  • Cristian
  • Cristian's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 5
  • Thank you received: 0
The thing is that all those packages were already installed when i ran the yum install qt5-*.
On CentOS, for example, the error is asking me for this: "CXXABI_1.3.9" on the libstdc++.so.6 interface library.

So i ran this command:
nm -D /lib64/libstdc++.so.6 | grep CXXABI

and this is the output:
0000000000000000 A CXXABI_1.3
0000000000000000 A CXXABI_1.3.1
0000000000000000 A CXXABI_1.3.2
0000000000000000 A CXXABI_1.3.3
0000000000000000 A CXXABI_1.3.4
0000000000000000 A CXXABI_1.3.5
0000000000000000 A CXXABI_1.3.6
0000000000000000 A CXXABI_1.3.7
0000000000000000 A CXXABI_TM_1

as you can see it does NOT include it.

I read something about using the LD_LIBRARY command to load an ibstdc++.so.6 file that include CXXABI_1.3.9.. But, to be honest, i don't think this worth all this effort.
After all, as i said, the gtk2 version worked on all distros (and looked nicer)

Sir, i many thank you for your help.
I may not solved this particular issue but still I learned a lot in the process :side:

Please Log in or Create an account to join the conversation.

Library error on QT5 Apps 3 years 7 months ago #15024

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4508
  • Thank you received: 1100
Thanks Sir
In the modem "Programming Odyssey" the most important are the experience and the lessons learn from the journey,
these are the real "Ithaca".

Have fun...
PilotLogic Architect and Core Programmer

Please Log in or Create an account to join the conversation.

  • Page:
  • 1