Sign in Join

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

Mailing lists / fpc-pascal / 2002-08

Error compiling the unit Source code ssockets.pp

2 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

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

Stefan Becker

I'm receive the following error when compliling the unit's source. Am I missing a compiler switch or something?

fpc linux/ssockets.pp
  Compiling for LINUX Platform
  Compiling Debug Version
  Target OS: Linux for i386
  Compiling linux/ssockets.pp
  Compiling ./linux/sockets.pp
  sockets.inc(57,25) Hint: Parameter F not used
  sockets.inc(120,27) Error: Can't assign values to const variable
  sockets.pp(187) Fatal: There were 1 errors compiling module, stopping
The error happens here!
--------------------------------
Function DoConnect(Sock:longint;const addr: TInetSockAddr): Boolean;
begin                                                  ^^^^^
  DoConnect:=Connect(Sock,Addr,SizeOF(TInetSockAddr));
end;

There must be way to compile this!

grateful for anyone's help!

Stefan

Reply by email

Arne Hanssen
to Stefan Becker

Thus spoke Stefan Becker ():

Show quoted text 21 lines
I'm receive the following error when compliling the unit's source. Am I missing a compiler switch or something? > fpc linux/ssockets.pp Compiling for LINUX Platform Compiling Debug Version Target OS: Linux for i386 Compiling linux/ssockets.pp Compiling ./linux/sockets.pp sockets.inc(57,25) Hint: Parameter F not used sockets.inc(120,27) Error: Can't assign values to const variable sockets.pp(187) Fatal: There were 1 errors compiling module, stopping The error happens here! -------------------------------- Function DoConnect(Sock:longint;const addr: TInetSockAddr): Boolean; begin ^^^^^ DoConnect:=Connect(Sock,Addr,SizeOF(TInetSockAddr)); end; There must be way to compile this!

I do not know anything about the Function DoConnect, but since the compiler complains about the 'addr' variable being a const variable, try changing 'const' to 'var', i.e:

Function DoConnect(Sock:longint;var addr: TInetSockAddr): Boolean; ^^^
Hope this helps (and don't break anything)! :-)

Vennlig hilsen / Best regards |\ ___,,--, _ Arne Hanssen, Senja, Norway /,`--'' \-,,__,'/ http://www.tuxic.net/arne/ |,4 ) )_ ) /~-----' http://home.c2i.net/bkgras/ -----'---^~(_/-_)--(_/_)-------

Reply by email