Recent

Author Topic: First Pascal Application  (Read 3561 times)

dbannon

  • Hero Member
  • *****
  • Posts: 1598
    • tomboy-ng, a rewrite of the classic Tomboy
Re: First Pascal Application
« Reply #15 on: October 11, 2021, 01:58:04 am »
Thaddy, yes, there are still some issues on the Mac, but just about all software has issues of some sort. A functional install of FPC/Lazarus is relatively easy and many people are using it right now.

I only use my (poor old) Mac to do prerelease testing, all development is done on Linux but thats just because the Mac UI drives me mad! 

Jon, my MacOS install is probably not typical and may well be bad advice. I am a long term Unix user. (Although Thaddy once called me a Windows user and has still not apologized  :) ) I rewrote the Wiki page I referred you to earlier some years ago and had hoped it has been extensively rewritten since then, sadly I recognise much of the wording ....

trev would be a lot more help here but it does not seem he is around.

Further to Handoko's advice for finding errant Lazarus file, when Lazarus starts up the first time, it creates a set of config files in (default)  $HOME/.lazarus. If you re-install a different way it will probably look there and assume the files there apply, nominally, version number is the same.  So, part of your clean out exercise is to remove, completely, .lazarus from your home directory. It gets rebuilt automatically.

In my humble opinion, the best way to install FPC/Lazarus (on any platform) is to use the supplied binary install packages for FPC and FPC-SRC from sourceforge, links in the wiki page.  Get that working, test it and then download the Lazarus source and compile it. FPC is a compiler, its a good one, compiling is what its good at !

That way you can put your Lazarus install in user space, where you want it and you have a full understanding of where it is and which version you are using. It does not need to be on your path, you cd to the install directory and start from there.

Details -
1. You do not need to use git or svn to down load Lazaus source. Anyone other than Lazarus developer should (IMHO) just download a zip file. Move an existing install out of the way, unzip the new one, change into the dir, type "make all LCL_PLATFORM=cocoa CPU_TARGET=x86_64 bigide". If its trunk or Fixes, repeat every few months.

2. I always use the --PCP=somewhere option to lazarus (or better, create a lazarus.cfg in your lazarus directory with that same info). Again, just so I am sure which files are being used.

3. To start a source installed Lazarus, cd into the install dir and start from there. Or create a bash script, I keep mine in ~/bin, like this (in my case 'trunk' is my Lazarus install dir below $HOME/bin/Lazarus, you will probably have different names) -

Code: Bash  [Select][+][-]
  1. #!/bin/bash
  2. LAZDIR="trunk"
  3. cd "$HOME/bin/Lazarus/$LAZDIR"
  4. open "$HOME/bin/Lazarus/$LAZDIR"/lazarus.app --args "--pcp=$HOME/.$LAZDIR"

4. You really should not be taking advice about MacOS from an old Unix hack.

Davo


« Last Edit: October 11, 2021, 02:40:37 am by dbannon »
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1624
  • Former Delphi 1-7, 10.2 user
Re: First Pascal Application
« Reply #16 on: October 11, 2021, 02:52:00 am »
I'm missing for a day and...  :o

The Mac Portal on the Wiki has lots of useful information including:

* Installing Lazarus on macOS

* Uninstalling Lazarus on macOS

If you're still having issues, please follow the uninstallation instructions and start afresh.
Lazarus 2.3 + FPC 3.3.1 2021-10-19 macOS 10.14.6 Xcode 11.3.1
Lazarus 2.3 + FPC 3.3.1 2021-09-21 macOS 11.6 aarch64 Xcode 13
Lazarus 2.3 2021-08-11 FPC 3.2.2 FreeBSD 13.0 amd64 VMware VM
Lazarus 2.1 r61574 FPC 3.0.4 Ubuntu 20.04 Parallels VM
Lazarus 2.0.10 FPC 3.2.0 Win10 Parallels VM

Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 757
  • Professional amateur ;-P
Re: First Pascal Application
« Reply #17 on: October 11, 2021, 02:57:18 am »
Hey Trev,

<completely_off_topic_and_dripping_sarcasm>
I'm missing for a day and...  :o

What do you mean you need some personal time!?!?!?
Isn't the 30m power nap you take each nite enough for that!?!?
<insert_whip_cracking_gif/>

</completely_off_topic_and_dripping_sarcasm>

Cheers,
Gus
Lazarus 2.3.0(trunk) FPC 3.3.1(trunk) Ubuntu 21.04 64b Dark Theme
Lazarus 2.0.12(stable) FPC 3.2.2(stable) Ubuntu 21.04 64b Dark Theme
http://github.com/gcarreno

Thaddy

  • Hero Member
  • *****
  • Posts: 10929
Re: First Pascal Application
« Reply #18 on: October 11, 2021, 08:23:41 am »
Isn't the 30m power nap you take each nite enough for that!?!?
Huh? That is IONS.

Isn't 30 µs enough for a power nap...? (I am being generous here)
« Last Edit: October 11, 2021, 08:25:31 am by Thaddy »
The average programmer productivity is 4-5 hours per day. Peak performance 72 hours for short bursts. MTBF is 1 second or less.

Jon Trepte

  • New member
  • *
  • Posts: 9
Re: First Pascal Application
« Reply #19 on: October 11, 2021, 11:29:58 am »
First let me thank all how have taken the time to assist me. Especially Thaddy and Handoko. I'm a bit closer now in that I can get thing to compile but I still have one problem left. When I run an empty project I get the following.

Compile Project, CPU: i386, Target: /Users/jontrepte/tmp/project1: Exit code 1,
Errors: 1
Linking /Users/jontrepte/tmp/project1
ld: framework not found Cocoa
An error occurred while linking
Error: Error while linking

Any ideas? Maybe something to do with Xcode

Running Xcode 13
fps 3.3.3
Lazarus 2.0.12

mischi

  • Full Member
  • ***
  • Posts: 156
Re: First Pascal Application
« Reply #20 on: October 11, 2021, 12:20:39 pm »
The problem is that your default cpu target is i386 and there is no Cocoa library/framework for 32bit. This should be fixed by explicitly setting the cpu target to x86-64. Do you need more details?

MiSchi.

Jon Trepte

  • New member
  • *
  • Posts: 9
Re: First Pascal Application
« Reply #21 on: October 11, 2021, 01:14:02 pm »
Thanks mischi
I re installed the system using
fpc-3.2.0.intel-macosx.dmg
fpc-src-3.2.0-2-laz.pkg
Lazarus-2.0.12-x86_64-macosx.pkg
and all is working OK
Many thanks to all who helped me and I look forward to using the environment.
Kindes regards
Jon

Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 757
  • Professional amateur ;-P
Re: First Pascal Application
« Reply #22 on: October 11, 2021, 01:50:26 pm »
Hey Thaddy,

Isn't 30 µs enough for a power nap...? (I am being generous here)

ROTFL!!!

Cheers,
Gus
Lazarus 2.3.0(trunk) FPC 3.3.1(trunk) Ubuntu 21.04 64b Dark Theme
Lazarus 2.0.12(stable) FPC 3.2.2(stable) Ubuntu 21.04 64b Dark Theme
http://github.com/gcarreno

 

TinyPortal © 2005-2018