As I described in
another thread, I am trying to build a GUI application in 64bit in order to run on MacOS-12 or newer.
My app source code can be found here:
https://github.com/fangq/mcx/tree/master/mcxstudioit can be build with
lazbuild --ws=carbon --cpu=i386 mcxstudio.lpr
and run on all old MacOS without any issue. It uses
GLScene to render 3D objects and 3D volumetric data. However, carbon does not support x86_64, so I tried
lazbuild --ws=cocoa --cpu=x86_64 mcxstudio.lpr
the build is fine, but when running it, it always throw an error "Failed to create RenderingContext", see screenshot below. I tried lazarus 2.2.6 and 2.0.12, got the same error. This also happens on both macos 10.x and 12.x. So, it looks like cocoa does not work with OpenGL or GLScene.
I also tried other widgetsets, but all ended with various types of errors, for example:
$lazbuild --ws=qt5 --cpu=x86_64 mcxstudio.lpr
...
ld: framework not found Qt5Pas
An error occurred while linking
/Users/fangq/space/git/Project/github/mcx/mcxstudio/mcxstudio.lpr(20,34) Error: (9013) Error while linking
$lazbuild --ws=qt --cpu=x86_64 mcxstudio.lpr
...
(3104) Compiling ./glscene/GLLCLViewer.pas
/Users/fangq/space/git/Project/github/mcx/mcxstudio/./glscene/GLLCLViewer.pas(208,11) Error: (2023) User defined: unimplemented QT context
(3104) Compiling ./glscene/GLViewer.pas
/Users/fangq/space/git/Project/github/mcx/mcxstudio/./glscene/GLViewer.pas(44,1) Fatal: (10026) There were 1 errors compiling module, stopping
Fatal: (1018) Compilation aborted
$lazbuild --ws=gtk2 --cpu=x86_64 mcxstudio.lpr
...
(3104) Compiling ./glscene/GLWidgetContext.pas
(3104) Compiling ./glscene/GLCarbonContext.pas
/Users/fangq/space/git/Project/github/mcx/mcxstudio/./glscene/GLCarbonContext.pas(26,32) Fatal: (10022) Can't find unit CarbonDef used by GLCarbonContext
Fatal: (1018) Compilation aborted
Error: /usr/local/bin/ppcx64 returned an error exitcode
Error: (lazarus) Compile Project, Mode: Release, Target: debug/mcxstudio: stopped with exit code 1
Error: (lazbuild) failed compiling of project /Users/fangq/space/git/Project/github/mcx/mcxstudio/mcxstudio.lpi
it looks like qt5 is the closest to complete build as it failed only during linking while others failed during compilation.
in your opinion, is this a Cocoa widgetset bug? or is it a GLScene bug? if I want to resolve the
"ld: framework not found Qt5Pas" error, what should I do?
thanks