Lazarus

Installation => Mac OS X => Topic started by: d-_-b on August 14, 2018, 10:00:48 pm

Title: [error] make cocoa x86_64 cocoawsclipboard.pas fails without {$mode objfpc}{$H+}
Post by: d-_-b on August 14, 2018, 10:00:48 pm
Followed https://macpgmr.github.io/MacXPlatform/UsingCocoaFromTrunk.html to build lazarus from source(r58701) using brew fpc(Free Pascal Compiler version 3.0.4 [2017/12/06] for x86_64) for cocoa x64.

Make gave me a error for lcl/interfaces/cocoa/cocoawsclipboard.pas so I fixed it with adding `{$mode objfpc}{$H+}` to
cocoawsclipboard.pas as in the patch below:

Code: Pascal  [Select]
  1. Index: lcl/interfaces/cocoa/cocoawsclipboard.pas
  2. ===================================================================
  3. --- lcl/interfaces/cocoa/cocoawsclipboard.pas   (revision 58701)
  4. +++ lcl/interfaces/cocoa/cocoawsclipboard.pas   (working copy)
  5. @@ -2,6 +2,7 @@
  6.  
  7.  interface
  8.  
  9. +{$mode objfpc}{$H+}
  10.  {$modeswitch objectivec2}
  11.  
  12.  uses
  13.  

Should I create a bug?

Is my patch ok, coding wise?
Title: Re: [error] make cocoa x86_64 cocoawsclipboard.pas fails without {$mode objfpc}{$H+}
Post by: skalogryz on August 14, 2018, 10:37:16 pm
What error do you get?
Title: Re: [error] make cocoa x86_64 cocoawsclipboard.pas fails without {$mode objfpc}{$H+}
Post by: d-_-b on August 17, 2018, 04:52:14 am
make LCL_PLATFORM=cocoa CPU_TARGET=x86_64

Gave the following errors:

Code: Pascal  [Select]
  1. Compiling cocoaint.pas
  2. Compiling cocoawsclipboard.pas
  3. cocoawsclipboard.pas(139,3) Error: Identifier not found "Result"
  4. cocoawsclipboard.pas(145,3) Error: Identifier not found "Result"
  5. cocoawsclipboard.pas(166,3) Error: Identifier not found "result"
  6. cocoawsclipboard.pas(203,5) Error: Identifier not found "try"
  7. cocoawsclipboard.pas(204,7) Fatal: Syntax error, ";" expected but "FOR" found
  8. Fatal: Compilation aborted
  9. make[3]: *** [../lcl.ppu] Error 1
  10. make[2]: *** [cocoa_all] Error 2
  11. make[1]: *** [interfaces] Error 2
  12. make: *** [lcl] Error 2

With the {$mode objfpc}{$H+} added to cocoawsclipboard.pas as in my patch above I was able to make lazarus.app.
Title: Re: [error] make cocoa x86_64 cocoawsclipboard.pas fails without {$mode objfpc}{$H+}
Post by: skalogryz on August 20, 2018, 03:05:42 pm
thanks for the patch. it has been applied to the trunk