I organize the source code of the application in a Pascal compilation. Units Using File -> New Unit
The following module compiles OK ...
unit CryptoUnit; {$mode objfpc}{$H+} interface function Encrypt(key, plaintext:string):string; function Decrypt(key, ciphertext:string):string; implementation uses Classes, SysUtils, Blowfish; function Encrypt(key, plaintext:string):string; ...
However, this has compilation errors, since it cannot identify the βExceptionβ on line 6 ...
unit ExceptionUnit; {$mode objfpc}{$H+} interface procedure DumpExceptionCallStack(E: Exception); // <--- problem implementation uses Classes, SysUtils, FileUtil; { See http://wiki.freepascal.org/Logging_exceptions } procedure DumpExceptionCallStack(E: Exception); ...
If I assume that an Exception is defined in SysUtils (how can I say?), I cannot put uses SysUtils before the interface (the compiler complains that it was expecting an interface )
How to tell the compiler that Exception defined in SysUtils ?
source share