[Lazarus] Building a C (or possibly C++) program into a Lazarus app

Mark Morgan Lloyd markMLl.lazarus at telemetry.co.uk
Fri Aug 10 23:33:02 CEST 2018


On 10/08/18 20:45, leledumbo via Lazarus wrote:
>> I find myself wondering whether > they could be given a more friendly frontend by wrapping them in a > Lazarus app, with an on-screen keyboard similar to what's found on a > tablet etc.
> Sounds like my non-web hobby projects with Lazarus.
>> Is it possible to link a C or possibly C++ program into a Lazarus one by > simply calling its main() function? Has anybody actually done this?
> I don't do that, though. Even if technically possible, there are hiddenstuffs you have to be aware of. main() is only a specification in Cstandard, where the user code starts. However, long before that, there's astartup mechanism specific to each implementation. In GCC, this is _start,absolutely non-portable. That's why the IMO better way is to communicateover pipes via TProcess.

Thanks for that. The program I'm thinking about is actually pretty 
simple and ancient- written by Ken Thompson- so I might be in with a chance.

What I'd /really/ like to do is port it- complete with UI helper- to 
Android. However at that point I have to add my voice to Bo's plea of a 
couple of weeks ago: what's the current situation and future plans of 
Lazarus as far as Android is concerned? I see mention of Laz4Android in 
e.g. http://wiki.lazarus.freepascal.org/Android_tutorial : is that 
mainstream or is there some other preferred solution?

-- 
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]


More information about the Lazarus mailing list