Recent

Author Topic: macOS Larazus exit code 1, error 3  (Read 266 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: 1011
    • 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.2 | FPC 3.0.4 | PPC, Intel, ARM | macOS, Windows, Linux

Trenatos

  • Hero Member
  • *****
  • Posts: 501
  • 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.