[fpc-pascal] Error: Can't declare procedure as EXTERNAL
Den Jean
geeken at pandora.be
Fri Dec 3 03:15:21 CET 2004
Hi,
the new FPC CVS release of 29/11 forbids
delphi / kylix type of library use
eg
--------------------------------------------------------------------------------------------------------------
interface
function QObjectList_create: QObjectListH; cdecl; overload;
function QObjectList_create(list: QObjectListH): QObjectListH; cdecl; overload;
implementation
function QObjectList_create(list: QObjectListH): QObjectListH; cdecl; external QtShareName name QtNamePrefix + 'QObjectList_create2';
function QObjectList_create: QObjectListH; cdecl; external QtShareName name QtNamePrefix + 'QObjectList_create';
--------------------------------------------------------------------------------------------------------------
is forbidden now and generates a "Error: Can't declare procedure as EXTERNAL" when compiling.
Apparently the external directive has to be moved to the INTERFACE section.
I do not know why this has changed (perhaps a very good reason),
but to me it seems not so good:
1) This is not Delphi/Kylix compatible (just try to compile Qt.pas)
2) This breaks a lot of existing code, especially bindings ( I will need to move 3283 external directives in my qte binding)
And most importantly:
3) This way the interface gets cluttered with implementation details like "name QtNamePrefix + 'QObjectList_create2'"
kind regards,
Den Jean
More information about the fpc-pascal
mailing list