[fpc-devel]Export/import methods: possible?

Peter Vreman peter at freepascal.org
Mon Nov 10 20:26:48 CET 2003


> Hi!
> Just before fpc 2.0 is out, I'd like to ask if it would really be
> hard to allow to import/export methods (including constructors
> and destructors) like plain functions/procedures, e.x.:
> ...
>  exports TMyClass.Work name 'TMyClass_Work';
> ...
>  procedure TMyClass.Work; external 'mylib' name 'TMyClass_Work';
> ...
> The reason I ask is because (I think) this would give some
> (not elegant, but at least some) way to put class(es) implementation
> into a shared lib.
>

This hack will not be added to the compiler. When support for classes in
shared libraries is needed then it needs to be fixed correctly. When you
add hacks to a program to support something it'll face you again in the
future and will only give more trouble.








More information about the fpc-devel mailing list