Forum > macOS / Mac OS X

Linking error: Unsupported target architecture

(1/2) > >>

andies:
I just installed Lazarus on an Apple M1 (2020, OS Monterey 12.1) as described in the wiki. I did not install XCode but only the command line tools and had to upgrade them immediately. Then I installed the precompiled binary fpc and wrote my usual program

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---program Project1;begin  writeln('Hello World');end. and smoothly runs through fpc. Then I installed lazarus and if I compile this program I get the error

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---Error: Unsupported target architecture -Paarch64, invoke the "fpc" compiler driver instead.(I have used target OS=darwin and architecture=aarch64; if I use default I get an i386-error). Is there someone who can help me?

PS fpc Compiler version 3.2.2 [2021/05/16] for aarch64, Lazarus 2.2.0

VTwin:
Did you install:

fpc-3.2.2.intelarm64-macosx.dmg
fpc-src-3.2.2-20210709-macosx.dmg
Lazarus-2.2.0-0-x86_64-macosx.pkg

These work fine for me.

andies:
Yes, these are exactly the three files I used. On the first run I mixed everything up (starting with Lazarus instead of XCode compile tools), I then had to uninstall everything and started anew. To no avail.

Did you modify any of the config details in lazarus or fpc?

Jonas Maebe:
This suggests you have configured ppcx64 rather than "fpc" as your compiler binary in Lazarus (Lazarus menu -> Preferences -> Environment: compiler executable should be /usr/local/bin/fpc).

VTwin:
No. Maybe your lazarus config info was not updated when you reinstalled.

Try Jonas' answer.

Navigation

[0] Message Index

[#] Next page

Go to full version