[SOLVED] Command line application lazarus / 32-Linux ---------------------------------------------------------------------- MathMan · 2016-05-11 06:44 Hi all, I am currently using FPC 3.0.0 and Lazarus 1.6.0 under Ubuntu 15.04. What I would like to do is develop a small command line application which should do some measurements based on command line parameters. As I have never done this before, and being unsure about required settings in Lazarus and what parts of the RTL I would need to include I wanted to ask for some guidance. So question is - what do I have to consider to get this going - would someone care to help me out with a small skeleton if available. Kind regards, MathMan ---------------------------------------------------------------------- mig-31 · 2016-05-11 09:16 File -> New -> Console application ---------------------------------------------------------------------- Leledumbo · 2016-05-11 09:21 Quote from: mig-31 on May 11, 2016, 11:16:24 amFile -> New -> Console application I would suggest File -> New -> Program instead. Console application is a bit too complex for a start although you have all the benefits of TCustomApplication. ---------------------------------------------------------------------- MathMan · 2016-05-11 10:58 Thanks mig-31 and Leledumbo - I'll give it a try this way and see how far I get. ---------------------------------------------------------------------- molly · 2016-05-11 18:47 In case you are in need of some help with the command line options, please have a look at unit GetOpts, examples are present in documentation. You could of course always use the ParamStr and ParamCount routines as well. Depends a little on how complicated things are going to get. ---------------------------------------------------------------------- MathMan · 2016-05-12 05:09 mig-31, Leledumbo, molly, It was a busy night yesterday but I got it running. Used the approach suggested by mig-31 to go for "Console Application" as I got all the command line handling utilities (like HasOption, GetOptionValue, etc.) for free. Background was that I had increasing doubts about the benchmark measurements I got when I used the benchmarking tool that I integrated into my GUI application. Now I have a replication but as a command line tool - lo and behold there are differences between measuring from inside a GUI app to measuring from a console app inside a shell! There are still some small things to do, as I want to follow this http://www.intel.com/content/dam/www/public/us/en/documents/white- papers/ia-32-ia-64-benchmark-code-execution-paper.pdf as close as possible without restorting to kernel mode drivers. Anyway consider the issue solved. Regards, MathMan