Welcome, Guest
Username: Password: Remember me
CodeTyphon MacOS Development, discussions and problems
  • Page:
  • 1

TOPIC:

Qt4Pas in bundle 5 years 1 month ago #13222

  • Premysl Beran
  • Premysl Beran's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 48
  • Thank you received: 0
Hi all,

I started to use successfully the CT on Mac. I compiled my code developed under Windows and it works. So thanks for the very nice job. But I'm still a newcomer on the MacOS platform.

My colleague asked me if I can provide him with my MacOS version of my application. When I did he was not able to launch the app. The error was the following:
Application Specific Information:

dyld: launch, loading dependent libraries

Dyld Error Message:

  Library not loaded: /opt/local/libexec/*/Qt4Pas.framework/Versions/5/Qt4Pas

  Referenced from: /private/var/folders/*/MyAppName.app/Contents/MacOS/MyAppName

  Reason: image not found

So I tried to copy the Qt4Pas.framework directory to the bundle. But it was not sufficient because it probably needs some linking, especially to the bundle framework. Can anybody help me how to do that or how to deal with it?

Thanks for any comment.

With best regards

Premek

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

Qt4Pas in bundle 5 years 1 month ago #13225

  • Matis A.
  • Matis A.'s Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1060
  • Thank you received: 149
Sir
you can find the Qt4Pas.framework installation procedure to
codetyphon/ScriptsLin/ln_Typhon1_QT4pas_Make_Links.sh
# --- Remove MacPorts Qt4Pas Version -----
if [ -d /opt/local/libexec/qt4/lib/Qt4Pas.framework ] ;
then
sudo rm -fr /opt/local/libexec/qt4/lib/Qt4Pas.framework
echo "[INFO] REMOVE MacPorts Qt4Pas Version from /opt/local/libexec/qt4/lib/Qt4Pas.framework"
fi

# --- Remove OLD CT Qt4Pas Version -----
if [ -d /Library/Frameworks/Qt4Pas.framework ] ;
then
sudo rm -fr /Library/Frameworks/Qt4Pas.framework
fi

sudo cp -fr ${vCTDir}/qt4pas/${vCPUOS}/Qt4Pas.framework /Library/Frameworks/Qt4Pas.framework
sudo chmod -R 777 /Library/Frameworks/Qt4Pas.framework

# --- make internal links -----

sudo rm -f /Library/Frameworks/Qt4Pas

sudo chmod 777 /Library/Frameworks/Qt4Pas.framework/Versions/5/Qt4Pas
sudo ln -f -s /Library/Frameworks/Qt4Pas.framework/Versions/5/Qt4Pas /Library/Frameworks/Qt4Pas.framework/Qt4Pas
sudo chmod 777 /Library/Frameworks/Qt4Pas.framework/Qt4Pas
sudo chmod -R 777 /Library/Frameworks/Qt4Pas.framework


In 7zip file
codetyphon/allzips/binqt/qt4-x86_64-darwin.7z
you can find Qt4Pas.framework that CT use.
PilotLogic Core Programmer

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

Last edit: by Matis A..

Qt4Pas in bundle 5 years 1 month ago #13227

  • Premysl Beran
  • Premysl Beran's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 48
  • Thank you received: 0
Hi Matis,

Thanks for the info. I know when you install the CT you install the system libraries. At that time the scrip you described is launched. And if I compile my application it is linked to the that library.

Now when I distribute my application, I need also distribute the library Qt4Pas which is different that MacPorts use (as visible in the script). The described script needs root access. This is what I don't want.

When you need to do it in Win or Linux you just copy the library in the same directory as executable. I thought that the structure of macOS bundle can be used here. I could copy the Qt4Pas to the bundle and tell the application to link to it and not to the one in the system.

So idea was to create application bundle which allow to lunch the application without necessity to install any further libraries.

Thanks for help.

Premek

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

Qt4Pas in bundle 5 years 1 month ago #13228

  • Matis A.
  • Matis A.'s Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1060
  • Thank you received: 149
QT4 and QT5 by default need Qt4Pas and Qt5Pas libraries for ALL OSes.
Qt4Pas and Qt5Pas libraries are translations of QT C++ object API to Pascal.

MacPorts Qt4Pas and Qt5Pas versions have big problems, are Clang building with incorrect functions input types (latest MacOS 10.14.3).
The same problem exists with Qt4Pas and Qt5Pas libraries and on latest FreeBSD 12.0.

So if you want
<<.. to create application bundle which allow to lunch the application without necessity to install any further libraries.>>
you must select an other Platform.

On MacOS "Cocoa" it's the best choice as OS native platform. "Carbon" platform it's old.
On MacOS "GTK2" use only the libraries from MacPorts.

The Big Picture is that CodeTyphon on MacOS support all these platforms Cocoa, GTK2, QT4, QT5 and old Carbon
as Typhon IDE host platforms.
And we provide working and tested Qt4Pas and Qt5Pas versions out of the box.

The choice is yours :)
PilotLogic Core Programmer

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

Last edit: by Matis A..
  • Page:
  • 1