[fpc-pascal]trouble compiling a demo

Michael Van Canneyt michael.vancanneyt at wisa.be
Wed Feb 18 21:39:06 CET 2004


On Wed, 18 Feb 2004, Crabtree, Chad wrote:

> I am trying to compile this which is giving me hell
>
> unit MyError;
>
> {
>   Custom error reporting routines.
>
>      *** WINDOWS VERSION ***
> }
>
> interface
>
> procedure Say(msg : String);
> procedure SockError(msg : String);
> procedure SockSay(msg : String);
> procedure GenError(msg : String);implementation
>
> uses sockets;
>
> procedure Say(msg : String);
> begin
>    Writeln(stderr, msg);
> end;
>
> procedure SockError(msg : String);
> begin
>    Writeln(stderr, msg, SocketError);
>    Halt(1);
> end;
>
> procedure SockSay(msg : String);
> begin
>    Writeln(stderr, msg, SocketError);
> end;
>
> procedure GenError(msg : String);
> begin
>    Say(msg);
>    Halt(1);
> end;
>
> end.
>
> The error message is this.  I am new to this so I am having trouble
> understanding what's wrong.  the error message is
>
> myerror-win.pas(1,6) Error: Illegal unit name: MYERROR
> myerror-win.pas(9,1) Fatal: Syntax error, ; expected but INTERFACE found

I would say the error is quite clear.
The name of the unit must be the same as the filename it is in: myerror-win in this case.

Michael.




More information about the fpc-pascal mailing list