sorry for the extreme-dummy question but I need some advice: the fpc compiler has an inmense variety of command line options that aren't obvious to use, at least for a beginner like me. Please, there's any Quick-Guide or such for managing the compiler correctly? Is there any gcc to fpc guide?
fpc -? shows help and waits for each screen, fpc -h just goes on without asking for results (for pipe operation)
Lazarus also has commandline parameters (like -Sd -S2 for the compiler dialect modes) in its compiler options dialogue.
In general you need dialect options (-Sd,-S2), directory options (-Fu, Fi), the command equivalent of $define (-dXXXX) and debug/smartlinking options (-g, -gl,-gw, -CX -XXs) the most.
I suggest you look into those first.
To start with, how do I manually compile a pas file from the command line?
fpc filename (with or without .pas extension)
The default dialect is "fpc", pass parameters (e.g. -Sd for Delphi mode) or add {$mode statements to the source.
how do I create a .so or dll library from the command line?
Generally the same. The contents of the main file (program, or library) determines if it is an executable or library
How shall I use the linker?
In general this is automatic. There are ways to bypass FPC and pass extra parameters.
How I dinamicaly link a library? and statically?
$linklib the libraryname in the source. The compiler should generally link whatever it finds with that name.
How do I compile a project with multiple units in it?
FPC finds its own files. Just pass the main module and directory options.