[Lazarus] "Running" a library
rgrunsky at sympatico.ca
Sat Sep 15 07:10:11 CEST 2012
On 12-09-14 10:39 AM, leledumbo wrote:
> Currently, if we have a library project, there's no way to test it without
> creating 2nd project which is an application. Should Lazarus implement
> something like V$ does? i.e. when "Run" is executed on a library project,
> the IDE then ask for an executable to run (the executable uses the library,
> so it will step into the library eventually). I have no idea whether gdb
> supports something like this or not.
It's been a very long time since I looked at this, and this is specific
to Windows. An exe and dll have the same basic structure, the difference
is that an exe can not export entry points and part of the startup will
initialize the stack and data segments. On the other hand, any procedure
called in a dll will assume that the stack pointer and segment registers
have been already set up. Also, I believe that there is only a single
entry point in an exe. Windows does provide a method to run a dll as a
program but I would assume that you have to pass the procedure in the
dll that you want to run. As I said this is from vague memory so the
details are fuzzy. At a minimum, to run a procedure in the dll you will
need some code to set up stack and data segments.
TRUTH in her dress finds facts too tight.
In fiction she moves with ease.
Stray Birds by Rabindranath Tagore
More information about the Lazarus