[fpc-pascal]Error compiling the unit Source code ssockets.pp

Arne Hanssen nite at c2i.net
Tue Aug 20 21:04:06 CEST 2002


Thus spoke Stefan Becker (becker at lufa-sp.vdlufa.de):

> 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/ -----'---^~(_/-_)--(_/_)-------




More information about the fpc-pascal mailing list