[fpc-pascal] Dynamic loading to static?

Ryan Joseph genericptr at gmail.com
Fri Oct 25 20:49:55 CEST 2019



> On Oct 25, 2019, at 12:02 PM, Michael Van Canneyt <michael at freepascal.org> wrote:
> 
> You need to manually change them.
> 
> if you look in the packages, you'll see that many library import units exist in 2
> flavours. One static, one dynamic.

That’s what I was afraid of.

btw, I why does ObjFPC mode not allow this but Delphi mode does? GetProcAddress returns a pointer and I get a type error which can’t be solved because the type of Py_Initialize  is anonymous, i.e. there is no formal declaration. Is there a way to cast around this in ObjFPC mode? It would be lots of extra work to add the extra types in because the original code was Delphi.

var
    Py_Initialize: procedure; cdecl;
begin
    Py_Initialize := GetProcAddress(handle, 'Py_Initialize');

Regards,
	Ryan Joseph



More information about the fpc-pascal mailing list