Recent

Author Topic: Linking new user code unit to library of precompiled ppu/o/lfm  (Read 2845 times)

fdsingleton

  • New Member
  • *
  • Posts: 31
My simulation language application DMSolver has been developed over many years & versions, and used to be limited to Delphi 3, but I have had one version that ran as a console application with an early FPC, and a newer version that ran with FPC 2.6.2 and Windows library belonging to Lazarus.  Lately I have little time to work on it.  When previous versions worked, I had a set of precompiled ppu/o/lfm, the user wrote special simulation language which was converted to a user Pascal unit, and FPC would compile and link the whole system to a Windows 32 bit exe.  Execution speed is very important as some simulations take many many minutes, but I would also like the user to be able to start up Lazarus and use the debugger only on his own code.  Delphi 3 is great at this, but it is not a freely distributed system.

I have been unable to make this work with the latest Lazarus and FPC 3.0.2.  Before getting into specifics, I have some general questions:  I am trying to find a strategy to make this work again.

If one changes the options coming after fpc ... does the system have to recompile all the code, including my proprietary units and the Lazarus Win32 units?  In my latest attempt to recreate my system, it appears so. 

Instead of running fpc <options> pgm in a .bat file when the user clicks on a button, if I make the user call up Lazarus, find his program, and run from there, will this be efficient?  It's a throwback to earlier versions 15 or 20 years ago.

Added note---first tries with this wanted the whole source code.  I will attempt to read manuals on "libraries", etc.

With FPC 3.0.0, I could never get a compile ONLY of the user unit and linkage with everything else.  It would declare a checksum error regardless.  With 2.6.2 I could manage after a recompile. 
« Last Edit: May 19, 2017, 08:22:04 pm by fdsingleton »

fdsingleton

  • New Member
  • *
  • Posts: 31
Re: Linking new user code unit to library of precompiled ppu/o/lfm
« Reply #1 on: May 24, 2017, 09:10:41 pm »
OK, I have finally got one successful compile/link with an fpc call (not the ide) linking to my proprietary units.  First I found that the lcl source code had to be included in the unit search list to get anywhere.  Then I found it would not get very far into my own units.  The barrier to this appears to be that I had a few functions and procedures in pure assembler with the ASSEMBLER; directive in the implementation but NOT in the interface.  Putting it also in the interface appears to have fixed my problem. 

 

TinyPortal © 2005-2018