Forum > macOS / Mac OS X

Errors when trying to build Lazarus on High Sierra

(1/3) > >>

hayanninja:
(For the record, if I remember correctly I had the same issues on vanilla Sierra too.)

Pre-built Lazarus install works, it's only when I try to rebuild it there are issues. However, I need to be able to rebuild in order to install design-time packages.

Setup:
- Late-2012 model Mac Mini
- Mac OS X High Sierra (the machine was reformatted with Sierra installed, then upgraded from there via App Store)
- XCode 9.2
- Lazarus 1.8.0
- FPC 3.0.4
- I also have access to Windows (10 Pro) and Linux (Ubuntu 16.04), so cross-compiling is an option if this might be more feasible

If I try to build with any widgetset with an i386 target, I get "Cannot find Interfaces unit used by Lazarus, incompatible ppu=[path to "interfaces.ppu" for relevant framework].

If I try to do the same with an x86_64 target, I instead get errors in CocoaGDIObjects.pas relating to identifiers not being found, specifically several that being with ATSU (eg. ATSUGetUnjustifiedBounds, ATSUCreateTextLayout, etc).

Once again, this happens no matter which widgetset I use.

I'm able to rebuild without issue on Windows (obviously, using the Win32/64 widgetset).

I've only tried so far to rebuild using the built-in "Build Lazarus" function; I haven't tried downloading the source code and building from scratch using only FPC, I'll try that if anyone thinks it'll be worthwhile.

Just to clarify, this happens regardless of whether it's an out-of-the-box build, or while trying to rebuild with extra packages installed.

Also, to clarify this as well - it is nothing to do with my own code. This will literally happen on a fresh install of Lazarus when I try to use the "Build Lazarus" option, no additional packages. (Saying this because while googling, I found another post where someone was mentioning a similar issue and one person insisted it must be a problem with the user's code.)

EDIT: Although I'd rather not, I am open to downgrading to an older version of Mac OS X if need be. I only use my Mac for development / testing and occasionally for some basic internet usage when I can't be bothered getting my Windows laptop out, so running an older version of the OS isn't a problem to me. I would need to know which one is best to use, though.

Phil:

--- Quote from: hayanninja on December 30, 2017, 12:44:23 am ---If I try to build with any widgetset with an i386 target, I get "Cannot find Interfaces unit used by Lazarus, incompatible ppu=[path to "interfaces.ppu" for relevant framework].

If I try to do the same with an x86_64 target, I instead get errors in CocoaGDIObjects.pas relating to identifiers not being found, specifically several that being with ATSU (eg. ATSUGetUnjustifiedBounds, ATSUCreateTextLayout, etc).

--- End quote ---

On macOS, you should only build with Carbon, which is 32-bit only (ppc386 compiler).

hayanninja:

--- Quote from: Phil on December 30, 2017, 01:00:10 am ---
--- Quote from: hayanninja on December 30, 2017, 12:44:23 am ---If I try to build with any widgetset with an i386 target, I get "Cannot find Interfaces unit used by Lazarus, incompatible ppu=[path to "interfaces.ppu" for relevant framework].

If I try to do the same with an x86_64 target, I instead get errors in CocoaGDIObjects.pas relating to identifiers not being found, specifically several that being with ATSU (eg. ATSUGetUnjustifiedBounds, ATSUCreateTextLayout, etc).

--- End quote ---

On macOS, you should only build with Carbon, which is 32-bit only (ppc386 compiler).

--- End quote ---

Carbon / i386 gives the "Cannot find Interfaces unit..." error.

The source file for it is there, and the PPU (and O) file gets created, but the compiler output complains that it's incompatible. I've tried messing a bit with the defines that I can see in the Interfaces.pas code, but it makes no difference.

That aside, if I'm not mistaken, High Sierra is intended to be the last OSX release to support 32-bit apps, no? So long-term, a solution for 64-bit is needed anyway; but solving just for 32-bit in the meantime is fine. With that being said, I should also ask - if I'm building for 32-bit on Mac OS X, is there anything I need to be aware of when trying to compile my code for other platforms? In the short-term I only need to also support Windows (and this can be compiled on Windows, I don't need to be able to cross-compile; also, doesn't really matter if it's 32-bit or 64-bit there) but longer-term I want to be able to support Android too, and possibly also Linux and iOS. (The last one is a very distant future thing for now, as I don't currently have any iOS device.)

Phil:

--- Quote from: hayanninja on December 30, 2017, 01:02:34 am ---Carbon / i386 gives the "Cannot find Interfaces unit..." error.

--- End quote ---

You're trying to build Laz with 64-bit Carbon, which does not exist. Try this from command line:

make LCL_PLATFORM=carbon CPU_TARGET=i386

I think this is related to change in FPC, where default compiler now builds for 64-bit. Probably wasn't tested on macOS.


--- Quote from: hayanninja on December 30, 2017, 01:02:34 am ---That aside, if I'm not mistaken, High Sierra is intended to be the last OSX release to support 32-bit apps, no? So long-term, a solution for 64-bit is needed anyway; but solving just for 32-bit in the meantime is fine.

--- End quote ---

Not quite right. Here's what Apple actually said:

https://developer.apple.com/news/?id=06282017a

So we don't know for sure if Carbon will be part of next version of macOS. What we do know for sure is that in a few days the Mac App Store will have 64-bit requirement.

hayanninja:

--- Quote from: Phil on December 30, 2017, 01:19:23 am ---
--- Quote from: hayanninja on December 30, 2017, 01:02:34 am ---Carbon / i386 gives the "Cannot find Interfaces unit..." error.

--- End quote ---

You're trying to build Laz with 64-bit Carbon, which does not exist. Try this from command line:

make LCL_PLATFORM=carbon CPU_TARGET=i386

I think this is related to change in FPC, where default compiler now builds for 64-bit. Probably wasn't tested on macOS.

--- End quote ---

This itself succeeds (I'm assuming I do this from the "lcl" subdir of Lazarus dir?), but makes no difference when I try to build Lazarus again afterwards. Lazarus seems to ignore the output from this and try to rebuild the whole LCL again anyway, thus once again generating the invalid Interfaces.ppu file. This happens regardless of what I set the cleanup option to.

Navigation

[0] Message Index

[#] Next page

Go to full version