Recent

Author Topic: How to download/compile libqt6pas Framework MacOS  (Read 895 times)

Theo11

  • New member
  • *
  • Posts: 9
How to download/compile libqt6pas Framework MacOS
« on: March 13, 2025, 12:17:47 pm »
Hi,

I am using Lazarus on MacOS and I want to do cross development for Mac and Windows. So I want to switch to QT6.

For that I need libqt6pas Framework library on MacOS.

Thanks,
Theo.

zeljko

  • Hero Member
  • *****
  • Posts: 1751
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: How to download/compile libqt6pas Framework MacOS
« Reply #1 on: March 13, 2025, 12:49:18 pm »
qmake is inside qt installation directory, eg /Users/foo/qt/6.5.3/macos/bin, use it with full path and it'll compile bindings w/o problems.

Theo11

  • New member
  • *
  • Posts: 9
Re: How to download/compile libqt6pas Framework MacOS
« Reply #2 on: March 19, 2025, 02:05:02 pm »
Hi Zeljko,

I don't have this folder.
Where do I get this?

I have downloaded qtbase-everywhere-src-6.8.2 tar file, but it has a different structure you are referring to.

Kind regards,
Theo.

zeljko

  • Hero Member
  • *****
  • Posts: 1751
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: How to download/compile libqt6pas Framework MacOS
« Reply #3 on: March 19, 2025, 06:13:35 pm »
Ah ,I'm using Qt installer so that's why I have everything at right place. Haven't tried build qt from source on mac, so cannot help you.

Theo11

  • New member
  • *
  • Posts: 9
Re: How to download/compile libqt6pas Framework MacOS
« Reply #4 on: March 24, 2025, 11:28:12 am »
Hi,

I am a step further, I have downloaded QT, brew install qt, and is now in folder /opt/homebrew/Cellar/qt, it's version 6.8.2_1.
So I have now qmake installed.  :D
Then I did the following:
- cd /Applications/lazarus/lcl/interfaces/qt6/cbindings
- qmake
- make
- make install
No errors, then I did:
- cd /Library/Frameworks
- ln -s /opt/homebrew/lib/Qt6Pas.framework .

Changed to QT6 widget in Lazaurs and added /Library/Frameworks/ to the library path.
When compiling the code I get a link error:
- Error: ld: framework 'Qt6Pas' not found

What is missing? :(
Any help?

Thanks,
Theo.

zeljko

  • Hero Member
  • *****
  • Posts: 1751
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: How to download/compile libqt6pas Framework MacOS
« Reply #5 on: March 24, 2025, 11:32:32 am »
Add -L/Library/Frameworks to the lazarus build options.

Theo11

  • New member
  • *
  • Posts: 9
Re: How to download/compile libqt6pas Framework MacOS
« Reply #6 on: March 24, 2025, 09:33:30 pm »
I have already added the /Library/Frameworks, but still no success.
These are my compiler options:
/usr/local/bin/fpc
-Tdarwin
-Paarch64
-MObjFPC
-Scghi
-O1
-gw3
-gl
-l
-vewnhibq
-Filib/aarch64-darwin
-Fl/Library/Frameworks
-Fu/Applications/lazarus/lcl/units/aarch64-darwin/qt6
-Fu/Applications/lazarus/lcl/units/aarch64-darwin
-Fu/Applications/lazarus/components/freetype/lib/aarch64-darwin
-Fu/Applications/lazarus/components/lazutils/lib/aarch64-darwin
-Fu/Applications/lazarus/packager/units/aarch64-darwin
-Fu.
-FUlib/aarch64-darwin
-FE.
-osdmanager
-dLCL
-dLCLqt6

Any hints?

Theo.

PetrHlozek

  • New Member
  • *
  • Posts: 12
Re: How to download/compile libqt6pas Framework MacOS
« Reply #7 on: April 25, 2025, 08:41:53 pm »
The same problem here. Just cloned the recent master.

did:

Code: Pascal  [Select][+][-]
  1. make bigide LCL_PLATFORM=qt6

Code: Pascal  [Select][+][-]
  1. (9009) Assembling pkgmanager
  2. /Users/petr/tmp/lazarus/ide/lazarus.pp(78,5) Hint: (5023) Unit "FPCUnitTestRunner" not used in Lazarus
  3. (9009) Assembling lazarus
  4. (9022) Compiling resource ../units/aarch64-darwin/qt6/lazarus.or
  5. (9015) Linking ../lazarus
  6. -macosx_version_min has been renamed to -macos_version_min
  7. ld: warning: -multiply_defined is obsolete
  8. ld: warning: ignoring duplicate libraries: '-lc'
  9. ld: framework 'Qt6Pas' not found
  10. An error occurred while linking
  11. Error: (9013) Error while linking
  12. Fatal: (10026) There were 1 errors compiling module, stopping
  13. Fatal: (1018) Compilation aborted
  14. make[2]: *** [lazarus] Error 1
  15. make[1]: *** [bigide] Error 2
  16. make: *** [idebig] Error 2

Without qt6:
Code: Pascal  [Select][+][-]
  1. (9015) Linking ../lazarus
  2. -macosx_version_min has been renamed to -macos_version_min
  3. ld: warning: -multiply_defined is obsolete
  4. ld: warning: ignoring duplicate libraries: '-lc'
  5. ld: warning: no platform load command found in '/Users/petr/tmp/lazarus/units/aarch64-darwin/cocoa/lazarus.or', assuming: macOS
  6. ./../ppaslink.sh: line 9: 90805 Segmentation fault: 11  /Library/Developer/CommandLineTools/usr/bin/ld -weak_framework AppKit -weak_framework UserNotifications -order_file ../symbol_order.fpc -multiply_defined suppress -L. -o ../lazarus `cat ../link90210.res` -filelist ../linkfiles90210.res
  7. An error occurred while linking
  8. Error: (9013) Error while linking
  9. Fatal: (10026) There were 1 errors compiling module, stopping
  10. Fatal: (1018) Compilation aborted
  11. make[2]: *** [lazarus] Error 1
  12. make[1]: *** [bigide] Error 2
  13. make: *** [idebig] Error 2

Any ideas, please? Thank you!
« Last Edit: April 25, 2025, 08:50:34 pm by PetrHlozek »

dbannon

  • Hero Member
  • *****
  • Posts: 3352
    • tomboy-ng, a rewrite of the classic Tomboy
Re: How to download/compile libqt6pas Framework MacOS
« Reply #8 on: April 26, 2025, 01:56:21 am »
Not an answer, a suggestion.

The beauty of Lazarus is you code will (almost) work perfectly using the native widget set. So, write your code for (eg) Windows using Windows default, win32 the move it to the Mac, the default is now Cocoa, it will probably compile and run as expected. Yes, from time to time, you might need the occasional {$ifdef WINDOW} etc to cover up an odd difference between widget sets, so, good idea to test cross platform frequently.

When you get to moving it to Linux, yep, I strongly recommend Qt6 not the default Gtk2.

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

TRon

  • Hero Member
  • *****
  • Posts: 4371
Re: How to download/compile libqt6pas Framework MacOS
« Reply #9 on: April 26, 2025, 02:04:00 am »
Any ideas, please? Thank you!
Can't answer the qt issue (maybe the following solves both issues, dunno) but see this thread.
Today is tomorrow's yesterday.

 

TinyPortal © 2005-2018