Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2004-02

trouble compiling a demo

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Crabtree, Chad

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
Exit code: 1

------------------------------------------------------------------------------------------- ***National City made the following annotations
-------------------------------------------------------------------------------------------

This communication is a confidential and proprietary business communication. It is intended solely for the use of the designated recipient(s). If this communication is received in error, please contact the sender and delete this communication.
===========================================================================================

Michael Van Canneyt
to Crabtree, Chad
Chad wrote 48 lines
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.