Forum > macOS / Mac OS X

Illegal type conversion of "Pobjc_object"

<< < (2/3) > >>

dbannon:

--- Quote from: CCRDude on February 20, 2024, 11:10:55 pm ---...
lazarus/lcl/interfaces/carbon/pascocoa/appkit/NSGraphicsContext.inc (old)
....

--- End quote ---

That file is in the Carbon tree, my guess is you are not using carbon ?

Davo

CCRDude:
My issue is basically: when I press "Compile" on the package window, which widgetset is used? One day, these errors occured (the IDE seemed to have used Carbon to compile), the other day they did not.
I like to click "Compile" to verify my code before I add a package to the IDE or a project.

If Carbon has been so deprecated that it cannot be used, why keep it in there at all?
But if it's basically a different version of the same file, why does Carbon not use the newer one as well?
Or maybe at least add a comment to the old Carbon file telling the user that if he's encountering an issue in this line, he probably forgot to set the widgetset to Cocoa?

I'm not using this file directly, I'm simply using CocoaAll.

And I'm not the only one affected, see this thread - someone who tried to compile my package had the same issue.

Zvoni:

--- Quote from: CCRDude on February 21, 2024, 11:50:11 am ---If Carbon has been so deprecated that it cannot be used, why keep it in there at all?

--- End quote ---
Backwards-Compatibility to High-Sierra and older?
https://en.wikipedia.org/wiki/Carbon_(API)

dbannon:

--- Quote from: CCRDude on February 21, 2024, 11:50:11 am ---My issue is basically: when I press "Compile" on the package window, which widgetset is used? One day, these errors occured (the IDE seemed to have used Carbon to compile), the other day they did not.

I'm not using this file directly, I'm simply using CocoaAll.


--- End quote ---
My guess, and its just a guess, you are probably using a Mac that does not support Carbon. So, anything that builds and runs is not using the Carbon one.

I am unsure what you mean by CocoaAll.  If (IFF) you are using LCL, on a Mac, its either Carbon (and it probably won't compile, certainly wont run on anything recent) or Cocoa (an obvious choice). You would select that in Lazarus->Project->ProjectOptions->Additions&Overrides. But if you are working directly with fpcsrc/packages/cocoaint, all bets are OFF !

Davo

CCRDude:
I'm running Ventura, 13.6.4, while Carbon was only available until Catalina, 10.15, so that's right, my Mac doesn't support it.

CocoaAll means the name of the unit I include, and that that's my only reference to anything Mac specific. To clarify: I'm not using any NSGraphicsContext.inc specifically, but that it only got involved by referring to the CocoaAll unit.

I am using the LCL, and yes, for apps I can set Cocoa, but not for packages (which should work on multiple widgetsets, that's right, but which shouldn't fail on a post-Carbon Mac trying to compile a package!).

Here's the source I'm working on:
https://gitlab.com/ccrdude-pascal/firefly-macos
I'm trying to create a LCL component making it easier to provide a form with a NSToolbar.

Here's my thread in this forum about it:
https://forum.lazarus.freepascal.org/index.php/topic,66309.0.html
And user Hansaplast, trying up to date trunk builds of aarch64-darwin-cocoa, had the same issue with the package.

I guess it leads to this question: which widgetset does the IDE pick to compile for when compiling a package?

Once the package has been added to the current project, it will be built with the projects current setting when recompiling the project, and later probably the same when directly compiling the package, but what is when the package is really new, hasn't been added to project or IDE yet?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version