Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2016-01

Can I build a Lazarus GUI program only with fpc installed?

8 messages · 6 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Bo Berglund

If I install only fpc is it then possible to build a GUI program from sources without also installing Lazarus (on Linux target)?

Say that I have a simple GUI program that is imported in Lazarus from Delphi7 by using the import tool in Lazarus on a Linux platform. It builds and runs OK on that platform.

Then I have a need to compile on another linux platform (different CPU etc) but do not want to/am able to install Lazarus there but fpc is available. Can I transfer the sources to that platform and then build on the command line somehow?

I have tried to find info on this on the web but what I find is very condensed and hard to understand....

The steps I thought of would be something like this:

apt-get install fpc
apt-get install (long list of dependencies for lazarus) transfer sources (5-10 files) to ~/projects/code
cd ~/projects/code
issue command to build program

But what would that command look like?
Or is lazarus necessary to build a fpc GUI program (as opposed to a command line program)?

I have seen talk about the fpc.conf file used to set some options, but there is a global such file in /etc and I do not see how one must change that for each project to build...
Whatever needed as source info should be in the project dir or on the command line, right?

Or can a makefile be generated in the system where the program is created and used on the target system without Lazarus? If so, how?

Bo Berglund Developer in Sweden

Reply by email

Anthony Walter
to Bo Berglund

At a minimum for lcl graphics form applications you need the lcl and lazbuild installed, as well as a valid set of config files, all of which are included with Lazarus. If you want to build just using fpc, then you'll need to gather at least those pieces together, and the easiest way to do that is to install Lazarus.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20160117/024192ce/attachment.html>

Reply by email

Graeme Geldenhuys
to Bo Berglund: If I install only fpc is it then possible to build a GUI program from sources without…
Bo Berglund wrote
If I install only fpc is it then possible to build a GUI program from sources without also installing Lazarus (on Linux target)?

Of course it is - as long as you have all the dependencies installed too, and if you application is LCL based, you obviously need the LCL sources too.

I have done that before on a Linux build server, and recently I have used MSEide to manage and build LCL based applications (all without lazbuild or a Lazarus IDE executable around).

The list of source paths (for building LCL) was large, but very doable. MSEide made this a bit easier with its support for path macros and quick setup of unit and include path setup. But if you are going to use purely FPC from the command line, I would create a config (text) file that holds all the compiler parameters - one parameter per line, then compile your project as follows:

fpc @extrafpc.cfg myproject.lpr

Another option would be to use FPC's fpmake.pp functionality. I don't know if Lazarus includes such a file already. Otherwise take a look at fpGUI's sources (<fpgui>/src/fpmake.pp) for a working example.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp

Reply by email

Michael Schnell
to Bo Berglund
Bo Berglund wrote
ditch the platforms that would not allow me to install Lazarus...

It should be possible to link a project against the LCL without completely installing Lazarus or using Lazarus on that platform

This does not even require cross compiling.

The project is just source coed. You can develop it on an appropriate platform (best as similar to the final target as possible).

Then (provided you already do have a compiler and the RTL on the target system, plus the required Linux Widget Set stuff) you can copy the source codes of your project and the LCL sources onto the target system and compile via command line.

So you will generate the fully featured GUI based program.

-Michael

Reply by email

Mattias Gaertner
to Michael Schnell
Show quoted text 6 lines
On 01/21/2016 09:51 AM, Bo Berglund wrote: > ditch the platforms that would not > allow me to install Lazarus... It should be possible to link a project against the LCL without completely installing Lazarus or using Lazarus on that platform

If you want to build GUI programs the needed external libraries of the IDE are the same as for any LCL application.
You don't need gdb, nor a working window manager to build a GUI application though.

Mattias

Reply by email

Michael Van Canneyt
to Mattias Gaertner
Mattias Gaertner wrote 14 lines
On Thu, 21 Jan 2016 10:14:33 +0100 Michael Schnell wrote: > On 01/21/2016 09:51 AM, Bo Berglund wrote: >> ditch the platforms that would not >> allow me to install Lazarus... > > It should be possible to link a project against the LCL without > completely installing Lazarus or using Lazarus on that platform If you want to build GUI programs the needed external libraries of the IDE are the same as for any LCL application. You don't need gdb, nor a working window manager to build a GUI application though.

Indeed.
I daily build GUI programs on a headless build machine, using lazbuild and FPC.

Michael.

Reply by email