Sign in Join

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

Mailing lists / fpc-pascal / 2004-06

Newbie to FPC: Can't compile

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

Ivan Stamenkovic

Hello,

The following code I can't compile. FPC reports there's no unit Linux. I use FPC 1.0.4 (both IDE and command line compiler), win32 version. The code is from 'Reference Guide', Chapter 18.

Is it actually possible at all?

TIA,
Ivan

Program Client;

{
Program to test Sockets unit by Michael van Canneyt and Peter Vreman Client Version, First Run sock_svr to let it create a socket and then sock_cli to connect to that socket
}

uses Sockets, Linux;
procedure PError(const S : string);
begin
  writeln(S,SocketError);
  halt(100);
end;
Var
  Saddr    : String[25];
  Buffer   : string [255];
  S        : Longint;
  Sin,Sout : Text;
  i        : integer;
begin
  S:=Socket (AF_UNIX,SOCK_STREAM,0);
  if SocketError0 then
   Perror('Client : Socket : ');
  Saddr:='ServerSoc';
  if not Connect (S,SAddr,Sin,Sout) then
   PError('Client : Connect : ');
  Reset(Sin);
  ReWrite(Sout);
  Buffer:='This is a textstring sent by the Client.';
  for i:=1 to 10 do
   Writeln(Sout,Buffer);
  Flush(Sout);
  Readln(SIn,Buffer);
  WriteLn(Buffer);
  Close(sout);
end.

Reply by email

Peter Vreman
to Ivan Stamenkovic
Show quoted text 7 lines
Hello, The following code I can't compile. FPC reports there's no unit Linux. I use FPC 1.0.4 (both IDE and command line compiler), win32 version. The code is from 'Reference Guide', Chapter 18. Is it actually possible at all?

The code is made for linux only and does not support win32.

Reply by email