Sign in Join

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

Mailing lists / fpc-pascal / 2021-02

compiling on command line linux

4 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

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

duilio foschi

Today I had to compile a program on my Linux server.

The program was written for windows and needed libraries synapse and lazutils, and they were missing from the server.

I copied all the needed units from my PC into the linux work directory and it worked with the usual command

fpc programname.pp

Unfortunately now my work directory is messy with tens of units (belonging to libraries synapse and lazutils) unworthily mixed with my poor code.

I guess that the kosher way is to create directories lazutils and synapse somewhere in the server but ... where?

Where should libraries be copied in linux?

How to make them accessible to the compiler?

Sorry for being so ignorant... I know how to do it in Lazarus on windows, but fpc on linux is rather arcane to me :)

Thank you

Duilio

Reply by email

Alexander Grotewohl
to duilio foschi

There's a command line parameter.. try something like

fpc -FU~/.units.lnx yourapp.pp

Of course you would have to remember to do that for EVERY compile (I set my text editor to do it) but you could probably add it to your fpc.cfg too.

Alexander Grotewohl https://dcclost.com ________________________________
Earlier message 27 lines
From: fpc-pascal on behalf of duilio foschi via fpc-pascal Sent: Monday, February 15, 2021 2:20:28 PM To: FPC-Pascal users discussions Cc: duilio foschi Subject: [fpc-pascal] compiling on command line linux Today I had to compile a program on my Linux server. The program was written for windows and needed libraries synapse and lazutils, and they were missing from the server. I copied all the needed units from my PC into the linux work directory and it worked with the usual command fpc programname.pp Unfortunately now my work directory is messy with tens of units (belonging to libraries synapse and lazutils) unworthily mixed with my poor code. I guess that the kosher way is to create directories lazutils and synapse somewhere in the server but ... where? Where should libraries be copied in linux? How to make them accessible to the compiler? Sorry for being so ignorant... I know how to do it in Lazarus on windows, but fpc on linux is rather arcane to me :) Thank you Duilio

Reply by email

Sven Barth
to Alexander Grotewohl
Alexander Grotewohl wrote
There's a command line parameter.. try something like fpc -FU~/.units.lnx yourapp.pp

Just to explain what -FUxxx does: this sets the unit output path. If you have precompiled units (or source files) in a different location you need to use -Fuxxx which sets the unit search path.

Of course you would have to remember to do that for EVERY compile (I set my text editor to do it) but you could probably add it to your fpc.cfg too.

You can add additional parameters to a custom file (just like you'd do with the global fpc.cfg) and then add it using the @ parameter:

fpc @your.cfg yourapp.pp

Regards,
Sven

Reply by email

duilio foschi
to Sven Barth

very good.

I created the new directories

./synapse and
./lazutils

in

/usr/lib/fpc/3.2.0/units/x86_64-linux

It worked like a charm.

It seems that all the units in that directory are searched by default.

Thank you

Duilio

AM Sven Barth wrote 24 lines
Am 15.02.2021 um 22:54 schrieb Alexander Grotewohl via fpc-pascal: There's a command line parameter.. try something like fpc -FU~/.units.lnx yourapp.pp Just to explain what -FUxxx does: this sets the unit output path. If you have precompiled units (or source files) in a different location you need to use -Fuxxx which sets the unit search path. Of course you would have to remember to do that for EVERY compile (I set my text editor to do it) but you could probably add it to your fpc.cfg too. You can add additional parameters to a custom file (just like you'd do with the global fpc.cfg) and then add it using the @ parameter: fpc @your.cfg yourapp.pp Regards, Sven

Reply by email