Delphi Error – E2293 Cannot have both a DLLImport attribute and an external or calling convention directive

Delphi Compiler Error

E2293 Cannot have both a DLLImport attribute and an external or calling convention directive

Reason for the Error & Solution

The compiler emits DLLImport attributes internally for external function declarations. This error is raised if you declare your own DLLImport attribute on a function and use the external name clause on the function.