Recent

Author Topic: [Solved] Running on OSX, no form?  (Read 4589 times)

Trenatos

  • Hero Member
  • *****
  • Posts: 535
    • MarcusFernstrom.com
[Solved] Running on OSX, no form?
« on: August 24, 2015, 05:41:14 pm »
I first posted this in the beginner section, but then remembered that there's a MAC OS X specific forum, so I'm posting here too, sorry about the crossposting.

I'm trying to run my software on OSX (10.6.8), and I've gotten Lazarus to load, and I can compile things.

However, when I move my software from Windows to the Mac and open the project, only the code editor opens, not the form.

If I try to Run it, the icon pops up in the docker but no form.

Same thing if I compile it, icon shows up but no window/form.

I can create new forms, but when I try to add anything and double click to open the handler, I get: Error in TDefaultComponentEditor, The component editor of class "TDefaultComponentEditor" has created the error:
Unable to find method. Please fix error shown below etc.

The error shown in the console is Error: Unit not found: Classes
« Last Edit: August 25, 2015, 11:38:59 pm by Trenatos »

eny

  • Hero Member
  • *****
  • Posts: 1634
Re: Running on OSX, no form?
« Reply #1 on: August 24, 2015, 06:02:42 pm »
I first posted this in the beginner section, but then remembered that there's a MAC OS X specific forum, so I'm posting here too, sorry about the crossposting
WTF >:(
Then don't do it...  >:D
All posts based on: Win10 (Win64); Lazarus 2.0.10 'stable' (x64) unless specified otherwise...

Trenatos

  • Hero Member
  • *****
  • Posts: 535
    • MarcusFernstrom.com
Re: Running on OSX, no form?
« Reply #2 on: August 24, 2015, 06:11:45 pm »
Oh noes, my first crosspost on these forums, how ever will people survive.

I'm a beginner with Lazarus/FPC, and I've no idea if this issue is a beginner one, or a specialty one.

If it's a beginner issue, it belongs in the beginner area, if it's a specialty issue it belongs in the MAC forum.

I don't know which one is best for getting a solution for the issue, so I committed the horrible crime of making people see the same post twice.    :P

Trenatos

  • Hero Member
  • *****
  • Posts: 535
    • MarcusFernstrom.com
Re: Running on OSX, no form?
« Reply #3 on: August 24, 2015, 07:40:47 pm »
Eny, I'll remove one of the posts if someone can tell me which forum I'm most likely to get help from.

jwdietrich

  • Hero Member
  • *****
  • Posts: 1232
    • formatio reticularis
Re: Running on OSX, no form?
« Reply #4 on: August 24, 2015, 08:36:47 pm »
You should try to narrow down the problem. One possibility is e.g. to create a very simple application (one form and one button) on Windows first. If it also runs on Mac the problem is in your project (or a component etc.), otherwise it is in your Lazarus installation.
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.2.6 | FPC 3.2.2 | PPC, Intel, ARM | macOS, Windows, Linux

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: Running on OSX, no form?
« Reply #5 on: August 24, 2015, 09:00:27 pm »
Are you sure that set of components used in the project are compiled with your Lazarus OSX installation?

I.e. if you're using a component that's not a part of default Lazarus installation, then you might need to install it first.
But even if component is installed, make sure it works fine with OSX.

However, when I move my software from Windows to the Mac and open the project, only the code editor opens, not the form.

If I try to Run it, the icon pops up in the docker but no form.
It might be the issue with the project not being run from a bundle.
Make sure that in your Project Options  "Use Application Bundle for running and debugging" is checked.

I can create new forms, but when I try to add anything and double click to open the handler, I get: Error in TDefaultComponentEditor, The component editor of class "TDefaultComponentEditor" has created the error:
Unable to find method. Please fix error shown below etc.

The error shown in the console is Error: Unit not found: Classes
sounds like you need to select at the Lazarus top menu: Tools -> Rescan FPC Source Directory
« Last Edit: August 24, 2015, 09:02:40 pm by skalogryz »

Trenatos

  • Hero Member
  • *****
  • Posts: 535
    • MarcusFernstrom.com
Re: Running on OSX, no form?
« Reply #6 on: August 25, 2015, 12:01:47 am »
Success!

@skalogryz, Application Bundle was already checked.

I did rescan the directory, and I also clicked "Create bundle", which went ok.

Tested again, no go, still no form (But no errors).

Then I realized that my windows machine is a multi-monitor setup.. I code on one and edit form on the other.

I add top/left := 10 to the FormCreate and BAM! There it is.

Likely the problem was that the window WAS showing up, but outside of the screen, as it goes to where it was the last time it was open..

Live and learn, and I've learned a bunch so far about Mac development and IFDEFs, let's see if luck keeps up and I can get this whole thing running on Mac and Linux in addition to Windows.

Thanks guys, I appreciate it     :)

 

TinyPortal © 2005-2018