Recent

Author Topic: Lazarus good for a multi-os menu?  (Read 2834 times)

PoodleBytes

  • Newbie
  • Posts: 2
Lazarus good for a multi-os menu?
« on: October 11, 2021, 03:18:57 pm »
Hi -
Pls excuse the newb question.  I am working on a high school project which I need to make a 'multi-OS main-menu'  that will evoke a program for the respective OS (Win/Linux/Mac).

Is Lazarus a good choice?   If so any beginner tips are greatly appreciated!

Thanks!

prof7bit

  • Full Member
  • ***
  • Posts: 144
Re: Lazarus good for a multi-os menu?
« Reply #1 on: October 11, 2021, 04:05:23 pm »
Lazarus is always a good choice for any Linux/Mac/Windows cross platform application. In fact it is pretty hard (if possible at all) to find any other tool besides Lazarus that would be equally qualified for such purpose.

Alextp

  • Hero Member
  • *****
  • Posts: 1485
    • UVviewsoft
Re: Lazarus good for a multi-os menu?
« Reply #2 on: October 11, 2021, 04:08:45 pm »
 Create the project for Windows. Then in the "project options" dialog, add "build modes". Each build-mode will compile app for its OS and/or widget set. Linux, Mac.

Don't forget to install CROSS compilers for all OS. Using fpcupdeluxe.

prof7bit

  • Full Member
  • ***
  • Posts: 144
Re: Lazarus good for a multi-os menu?
« Reply #3 on: October 11, 2021, 04:21:54 pm »
Create the project for Windows.
I personally found it overall less problematic to develop on Linux and then cross compile from there to other platforms, that way you won't accidentially rely on any window-isms or do stuff that later turns out to only work on Windows but nowhere else. The other way around tends to force me to attack all the problems in a cross compatible way from the ground up, and it also seems that most things I do on Linux will work out of the box on Windows too (with the exception of really low level stuff like serial ports or USB HID).

Then just be careful to not hardcode paths, always use constants like LineEnding or DirectorySeparator instead of hardcoding with #10#13 or '\' or '/' and stuff like that, with some experience you will recognize these possible problems before they happen and know how to avoid them.

Alextp

  • Hero Member
  • *****
  • Posts: 1485
    • UVviewsoft
Re: Lazarus good for a multi-os menu?
« Reply #4 on: October 11, 2021, 05:04:52 pm »
Quote
to develop on Linux and then cross compile from there to other platforms, that way you won't accidentially rely on any window-isms
Fully agreed!

mig-31

  • Sr. Member
  • ****
  • Posts: 287
Re: Lazarus good for a multi-os menu?
« Reply #5 on: October 11, 2021, 05:48:31 pm »
Yes, of course.
In my case, I usually develop application under Linux - my main development platform. If I need a binary file for Windows, I open source code under Windows and compile it. The same way as Lazarus tagline "Write ones. Compile anyway".

Sometimes I addapt size and position of GUI elements.




 
Lazarus 2.0.6 - CentOS 7.x, Mageia 7.1

PoodleBytes

  • Newbie
  • Posts: 2
Re: Lazarus good for a multi-os menu?
« Reply #6 on: October 11, 2021, 05:52:02 pm »
wow - thanks everyone for the fast & helpful response!

PascalDragon

  • Hero Member
  • *****
  • Posts: 3518
  • Compiler Developer
Re: Lazarus good for a multi-os menu?
« Reply #7 on: October 12, 2021, 09:01:08 am »
The same way as Lazarus tagline "Write ones. Compile anyway".

It's “Write once. Compile anywhere:P

af0815

  • Hero Member
  • *****
  • Posts: 773
Re: Lazarus good for a multi-os menu?
« Reply #8 on: October 12, 2021, 09:21:05 am »
Every widgetset on every platform have their spezial needness.

Eg. on Windows a button can not be colored, on Linux it is possible. You must take care of such small differents. One soloution is to use right components and this mean you must tests the first time on all platforms, all the used components. 

In the post before, there is the hint for installing all cross-compiler. This is the best way to test it. And use a Sourcecontrol system like git, so you can share the code between the systems and compile/test it nativ if needed.
 
regards
Andreas

funlw65

  • Jr. Member
  • **
  • Posts: 92
    • Visual Pin Configurator for Nucleo 64pin boards
Re: Lazarus good for a multi-os menu?
« Reply #9 on: October 14, 2021, 12:15:16 pm »
The same way as Lazarus tagline "Write ones. Compile anyway".

It's “Write once. Compile anywhere:P

I think it was a joke. Like what you would say after an apocalyptic war where you just found a functional laptop with an interesting IDE/language like Lazarus/fpc.
Lazarus 2.3.0 fpc 3.2.2, Linux, UNIX BSD
widgetset: gtk2, msegui, qt5

PascalDragon

  • Hero Member
  • *****
  • Posts: 3518
  • Compiler Developer
Re: Lazarus good for a multi-os menu?
« Reply #10 on: October 14, 2021, 01:28:44 pm »
The same way as Lazarus tagline "Write ones. Compile anyway".

It's “Write once. Compile anywhere:P

I think it was a joke. Like what you would say after an apocalyptic war where you just found a functional laptop with an interesting IDE/language like Lazarus/fpc.

I doubt that it was a joke, cause mig-31 mentioned that they use Lazarus' ability to simply recompile the code on a different platform.

 

TinyPortal © 2005-2018