Why is it not allowed to define procedures as "external" when they reside in a library checked in the library manager?
Example:
Code: Select all
{$IFDEF MMC} // for the mmc library (should be checked in the library manager)
function Mmc_Read_Sector(sector: longint; var dbuff: array[512] of byte): byte; external;
function Mmc_Write_Sector(sector: longint; var data_: array[512] of byte): byte; external;
{$ENDIF}
If such lines are commented out the error disappears.
I have seen also that "using" a library in a unit also prohibits that the library's routines can be declared external in that unit.
Above means also that faultless compiling of a unit depends on the fact that another library is checked in the library manager or not (a thing one does not can foresee when designing a unit that uses external procedures). Problems as above can pop up when e.g. users start to put .mcl files in packages and using them.
Of course, declaring routines external which are in 'libraries' is not necessary, but
- why is it forbidden?
- why is the error message not helpfull at all?
Thanks in advance!