I have a command line program running on a Linux server somewhere far in a datacenter. It uses Indy for networking. The program was running for a long time, but now I needed to make some cosmetic changes, but I could not compile the source, and later could not run the executable. Details are in a Networking thread:
https://forum.lazarus.freepascal.org/index.php/topic,67027.0.htmlNow I made some more checks and came across a number of problems:
- Paweld recommended to add Interfaces to the uses clause. After doing so, my program with Indy compiled but the executable got much-much larger (13.2MB instead of 3.5MB). I checked the Interfaces unit and it is related to gtk2 and forms, although as said above my program is a service running with no GUI, and even more not even accessing a terminal. So, I am totally confused why adding Interfaces was necessary to use Indy.
- Nonetheless, I can live with the extra large executable, but it did not run. The reason apparently is that the server is an older Linux than my Desktop, so the program does not have the right libraries. It is a bit bothering that FPC/Lazarus can cross-compile from Linux to e.g. Windows, but cannot cross-compile it to another Linux. Can there be an easy solution?
But then again, I can also live with this, if I compile the program on the server (sub-optimal solution, but anyway). However, I do not know how to do that. I have IndyLaz and other packages added as required packages in the Project Inspector of Lazarus. Although, I did compile other programs with FPC only, those were simpler ones. I do not know, how to do an FPC compilation, using these kind of Lazarus features. It is obvious that I cannot have Lazarus running, but then what sort-of makefile or config file is needed to compile Lazarus projects with FPC only.
Can you help in this last question, but would also be happy to get comments on the Interfaces question as well (the Linux version was detailed in the other thread, but any better idea is again welcome).