Recent

Author Topic: [CLOSED] Build app with all dependent library  (Read 3004 times)

MarkMLl

  • Hero Member
  • *****
  • Posts: 8012
Re: Build app with all dependent library
« Reply #15 on: June 21, 2024, 08:51:01 am »
I am pretty sure that this Ubuntu Server doesn't come with X installed, and won't be installed either.

The server is a firebird database server. My app is a small utility to backup and restore database for dummies users.

I came up with an idea, please suggest me if this is do able.

Instead of doing some troublesome to make my app runs on Ubuntu, I will make my app runs on Windows and do a remote backup/restore via Windows to Ubuntu Server. Is this possible?

We need a reality check here.

Have you used Lazarus to write a GUI app, than are expecting it to run on a server that has no GUI support installed?

If so then you can probably run it by SSHing in and tunneling the X11 UI... provided of course that the server is running X11 rather than Wayland, and subjecto to any other libc issues.

Otherwise you'll need to put it in a (Docker) container, or a VM.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

incendio

  • Sr. Member
  • ****
  • Posts: 291
Re: Build app with all dependent library
« Reply #16 on: June 21, 2024, 08:54:51 am »
Basically, my knowledge on Linux is only how to install firebird in Ubuntu.

After you guys mentioned about X, I just realized that my gui app won't run in this server.

I will try to modify my app so it will do remote backup and restore.

Flamerobin database manager on windows can do this, so I hope, Lazarus can do that also.

Thank you for all your help and hints.

MarkMLl

  • Hero Member
  • *****
  • Posts: 8012
Re: Build app with all dependent library
« Reply #17 on: June 21, 2024, 09:16:07 am »
I strongly suggest using FPC- not Lazarus/LCL- to write a simple "Hello, World!" and checking that you can run it on that server. If not then you need to take on board the issues that Robert/Don have mentioned about glib etc.

If a trivial program will work, then redo your backup program without a GUI. Later, there's ways that you can run a program either with or without a GUI. However I've not really explored what happens if you try moving a "GUI-optional" program to a system without X11... and Wayland remains a quagmire.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

cdbc

  • Hero Member
  • *****
  • Posts: 1646
    • http://www.cdbc.dk
Re: Build app with all dependent library
« Reply #18 on: June 21, 2024, 09:55:56 am »
Hi
If I may offer a suggestion...
If you're rewriting... Then why not do it in FPC(as Mark suggests) and engage the help of the library from Warfley, namely 'LazTextForms' to realize the TUI, because the db-controls can easily be created/used in code.
That way, it should run on anything 'Firebird'-server will run on...
The lib from Warfley is available here: https://github.com/Warfley/LazTextForms
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE5 -> FPC 3.2.2 -> Lazarus 2.2.6 up until Jan 2024 from then on it's: KDE5/QT5 -> FPC 3.3.1 -> Lazarus 3.0

incendio

  • Sr. Member
  • ****
  • Posts: 291
Re: Build app with all dependent library
« Reply #19 on: June 21, 2024, 12:10:58 pm »
Hi guys,

I managed to rewrite my app, it runs on client side on Windows and do backup & restore remotely without problem.

About FPC, never use it, is there a beginner guide how to use it?

cdbc

  • Hero Member
  • *****
  • Posts: 1646
    • http://www.cdbc.dk
Re: Build app with all dependent library
« Reply #20 on: June 21, 2024, 03:22:10 pm »
Hi
Quote
About FPC, never use it, is there a beginner guide how to use it?
Hehehe... You use it all the time ...behind Lazarus, it compiles all of laz' 'shenanigans' and you can happily use lazarus' code-editor to write console programs. It's actually a brilliant tool for that(too).
Try this:
1) create a new project in laz
2) instead of 'Application', choose 'Program' f.ex.
3) lazarus now creates a managed(by lazarus) program skeleton i.e.: lpr +
    support-files...
4) to see what's happening when you run your code in the debugger, you can
    click on Menu -> View -> Debug Windows -> Console In/Output
5) Have fun & happy coding  8-)
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE5 -> FPC 3.2.2 -> Lazarus 2.2.6 up until Jan 2024 from then on it's: KDE5/QT5 -> FPC 3.3.1 -> Lazarus 3.0

TRon

  • Hero Member
  • *****
  • Posts: 3623
Re: Build app with all dependent library
« Reply #21 on: June 21, 2024, 03:27:01 pm »
About FPC, never use it, is there a beginner guide how to use it?
Plausible deniability ?  :D
This tagline is powered by AI (AI advertisement: Free Pascal the only programming language that matters)

incendio

  • Sr. Member
  • ****
  • Posts: 291
Re: Build app with all dependent library
« Reply #22 on: June 21, 2024, 03:36:16 pm »
Hi
Quote
About FPC, never use it, is there a beginner guide how to use it?
Hehehe... You use it all the time ...behind Lazarus, it compiles all of laz' 'shenanigans' and you can happily use lazarus' code-editor to write console programs. It's actually a brilliant tool for that(too).
Try this:
1) create a new project in laz
2) instead of 'Application', choose 'Program' f.ex.
3) lazarus now creates a managed(by lazarus) program skeleton i.e.: lpr +
    support-files...
4) to see what's happening when you run your code in the debugger, you can
    click on Menu -> View -> Debug Windows -> Console In/Output
5) Have fun & happy coding  8-)
Regards Benny
Nice, thanks for the hints, will try it ASAP 👍

MarkMLl

  • Hero Member
  • *****
  • Posts: 8012
Re: Build app with all dependent library
« Reply #23 on: June 21, 2024, 05:18:33 pm »
Nice, thanks for the hints, will try it ASAP 👍

Detail: main unit is .lpr, other units are .pas files as usual. You'll have a .lpi ("Lazarus Project Information") file containing project paths and options, and .lps ("Lazarus Project State") which is usually temporary stuff you don't need to store in a version control system. You might have a .lpg if you've got the Lazarus Project Groups stuff installed.

That's about it. Debugging etc. pretty much as usual, but the IDE's console handling (View -> Debug Windows -> Console In/Output) is fairly rudimentary and if you have a long-running program you might prefer to start it from a normal shell and then tell the IDE to attach a debugger to it (YMMV on different OSes etc.).

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Thaddy

  • Hero Member
  • *****
  • Posts: 16152
  • Censorship about opinions does not belong here.
Re: Build app with all dependent library
« Reply #24 on: June 21, 2024, 05:39:02 pm »
Mark, a server does not even need a shell...Not to bash you. :D
All it really needs is a network stack.
If I smell bad code it usually is bad code and that includes my own code.

MarkMLl

  • Hero Member
  • *****
  • Posts: 8012
Re: Build app with all dependent library
« Reply #25 on: June 21, 2024, 05:40:45 pm »
Thaddy, stop being such an effing idiot. He's starting it from something, particularly during debugging on his development system.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Thaddy

  • Hero Member
  • *****
  • Posts: 16152
  • Censorship about opinions does not belong here.
Re: Build app with all dependent library
« Reply #26 on: June 21, 2024, 06:08:26 pm »
he already concluded that he had the answer...
If I smell bad code it usually is bad code and that includes my own code.

 

TinyPortal © 2005-2018