Recent

Author Topic: macOS Larazus exit code 1, error 3  (Read 2152 times)

statjy

  • Newbie
  • Posts: 2
macOS Larazus exit code 1, error 3
« on: June 07, 2019, 11:32:32 am »
I am using Laraus on my mac for the first time. I follow the tutorial, add 2 buttons and compile. The message pop out with 'exit code 1, error 3'. I checked the error 3 is about the path to the directory so I saved the unit and project in a fold that I can access. But the error is still there. What should I do? Thanks in advance.

The error message is: "
Target:project1: exit code 1,error: 3
Error: linker: Undefined symbols for architecture i386:
Error: linker:   "start", referenced from:
ld: symbol(s) not found for architecture i386
An error occurred while linking
project1.lpr(23,0) Error: Error while linking
"

jwdietrich

  • Hero Member
  • *****
  • Posts: 1036
    • formatio reticularis
Re: macOS Larazus exit code 1, error 3
« Reply #1 on: June 07, 2019, 08:39:24 pm »
Can you provide a simple demo project, so that we can reproduce the error? And, please note, which versions of Lazarus, Free Pascal and macOS you use.
function GetRandomNumber: integer; // xkcd.com
begin
  GetRandomNumber := 4; // chosen by fair dice roll. Guaranteed to be random.
end;

http://www.formatio-reticularis.de

Lazarus 2.0.6 | FPC 3.0.4 | PPC, Intel, ARM | macOS, Windows, Linux

Trenatos

  • Hero Member
  • *****
  • Posts: 508
  • Software developer - Open source contributor
    • MarcusFernstrom.com
Re: macOS Larazus exit code 1, error 3
« Reply #2 on: June 08, 2019, 09:04:20 am »
Should be targeting x86 and Cocoa.

statjy

  • Newbie
  • Posts: 2
Re: macOS Larazus exit code 1, error 3
« Reply #3 on: June 11, 2019, 12:41:29 pm »
Can you provide a simple demo project, so that we can reproduce the error? And, please note, which versions of Lazarus, Free Pascal and macOS you use.

My Lazarus is 2.0.0
FPC 3.0.4
MacOS is 10.14.5

I am not sure how to give the demo project. I included the project I am using below
Code: Pascal  [Select]
  1. program project1;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. uses
  6.   {$IFDEF UNIX}{$IFDEF UseCThreads}
  7.   cthreads,
  8.   {$ENDIF}{$ENDIF}
  9.   Interfaces, // this includes the LCL widgetset
  10.   Forms, Unit1
  11.   { you can add units after this };
  12.  
  13. {$R *.res}
  14.  
  15. begin
  16.   RequireDerivedFormResource:=True;
  17.   Application.Scaled:=True;
  18.   Application.Initialize;
  19.   Application.CreateForm(TForm1, Form1);
  20.   Application.Run;
  21. end.
  22.  

Alex Bonanno

  • Newbie
  • Posts: 2
Re: macOS Larazus exit code 1, error 3
« Reply #4 on: June 26, 2019, 02:42:30 pm »
I have the same problem simply rebuilding the IDE with standard packages.
I updated the IDE to version 2.0.2, FPC 3.0.4a.
I have MacOS Mojave 10.14.5 installed
I need help!
Thank you

trev

  • Full Member
  • ***
  • Posts: 243
  • Former Delphi 7 and Delphi 10.2 User
Re: macOS Larazus exit code 1, error 3
« Reply #5 on: June 27, 2019, 01:29:22 am »
You are going to have to give us more information.

1) Do you have Xcode installed? Version?
2) Have you installed the optional Xcode command line tools?
3) Have you installed the SDK headers?
4) What commands are you using to "simply rebuild" the IDE?
5) What are the error messages?
« Last Edit: June 27, 2019, 01:58:26 am by trev »
o Lazarus v2.1.0 r61775, FPC v3.3.1 r42640, macOS 10.14.6 (with sup update), Xcode 10.3
o Lazarus v2.1.0 r61574, FPC v3.3.1 r42318, FreeBSD 12.0 (Parallels VM)
o Lazarus v2.1.0 r61574, FPC v3.0.4, Ubuntu 18.04 (Parallels VM)

Alex Bonanno

  • Newbie
  • Posts: 2
Re: macOS Larazus exit code 1, error 3
« Reply #6 on: June 27, 2019, 10:48:05 am »
Thanks for your quick reply
1) Do you have Xcode installed? YES Version? Version 10.2.1 (10E1001)
2) Have you installed the optional Xcode command line tools? YES
3) Have you installed the SDK headers? NO, is important?
4) What commands are you using to "simply rebuild" the IDE? Menu Package/Install/Unistall packages, then add a package and go save and rebuild IDE.
5) What are the error messages?
Compile Project, Target: progressbar: Exit code 1, Errors: 3
Error: linker: Undefined symbols for architecture i386:
Error: linker:   "start", referenced from:
  "start", referenced from:
     implicit entry/start for main executable
ld: symbol(s) not found for architecture i386
An error occurred while linking
progressbar.pp(280,0) Error: Error while linking
progressebar is a lazarus example


thanks

trev

  • Full Member
  • ***
  • Posts: 243
  • Former Delphi 7 and Delphi 10.2 User
Re: macOS Larazus exit code 1, error 3
« Reply #7 on: June 27, 2019, 12:42:46 pm »
3) Have you installed the SDK headers? NO, is important?

Yes - Since macOS Mojave you need to install the SDK headers as well. Open a Terminal and then type:

open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg

which will start the pkg installer. Follow the prompts.
o Lazarus v2.1.0 r61775, FPC v3.3.1 r42640, macOS 10.14.6 (with sup update), Xcode 10.3
o Lazarus v2.1.0 r61574, FPC v3.3.1 r42318, FreeBSD 12.0 (Parallels VM)
o Lazarus v2.1.0 r61574, FPC v3.0.4, Ubuntu 18.04 (Parallels VM)