Recent

Author Topic: Trouble using fpSock / TTcpClient  (Read 5432 times)

tobie bos

  • Newbie
  • Posts: 5
Trouble using fpSock / TTcpClient
« on: October 13, 2018, 12:28:15 am »
I'm using Lazarus 1.8.4, fpc 3.0.4 on W10 (i386-win32-win32/win64)
The goal is to port a Delphi application -> free pascal (i am new to fpc).

i get the msg:  uTest.pas(5,11) Fatal: Cannot find fpSock used by uTest of the Project Inspector.

unit uTest;
interface
uses    ssockets, fpSock;

What did i do wrong?

tobie bos

  • Newbie
  • Posts: 5
Re: Trouble using fpSock / TTcpClient
« Reply #1 on: October 13, 2018, 01:06:11 pm »
why is ssocket ok and fpSock bad?
it is a fresh install of lazarus

can anybody help me?

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: Trouble using fpSock / TTcpClient
« Reply #2 on: October 13, 2018, 03:31:11 pm »
What package is fpSock part of?
Is that package defined as a dependency for your project?

tobie bos

  • Newbie
  • Posts: 5
Re: Trouble using fpSock / TTcpClient
« Reply #3 on: October 13, 2018, 03:43:45 pm »
i don't know which package;
lazarus finds the source in "C:\lazarus\fcp\3.0.4\source\packages\fcl-net\src\fpsock.pp"
(same location as ssockets.pp)

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: Trouble using fpSock / TTcpClient
« Reply #4 on: October 13, 2018, 04:03:49 pm »
OK, its part of fcl-net, and Lazarus knows where to find it.
The error message, then, probably indicates that the compiler does not like your fpSock.ppu.
Perhaps it is missing?Or you have two conflicting copies with the same name in the unit paths?Or it is corrupt (or an older version)?
If you know how to rebuild fpc clean, you could try that.
Or you may need to uninstall and reinstall fpc.
Or someone else who knows how to deal with troublesome .ppus may have a less drastic suggestion.

tobie bos

  • Newbie
  • Posts: 5
Re: Trouble using fpSock / TTcpClient
« Reply #5 on: October 13, 2018, 04:55:23 pm »
i found: "C:\FPC\3.0.4\units\i386-win32\fcl-net\ssockets.ppu"  (not in lazarus directory)
i did not find "C:\FPC\...\fcl-net\pkSock.ppu" anywhere on my system

in "Project inspector" i have no 'Required Packages'

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: Trouble using fpSock / TTcpClient
« Reply #6 on: October 13, 2018, 05:27:10 pm »
It should be at

C:\FPC\3.0.4\units\i386-win32\fcl-net\fpsock.ppu
Because it is part of FPC's system packages, you don't need to add anything as a dependency in the Project Inspector. The Lazarus IDE has an internal database of all FPC's paths etc. as applicable to the compiler on your system.
Somehow the Lazarus IDE makes sense of the jungle of known packages and unit paths and include files in a cross-platform way. This is actually very clever, and was programmed by someone who has intimate knowledge of both FPC and Lazarus, and who can maintain it in the face of an ever-growing number of new libraries and functionalities. I've never known this complex system to break.

tobie bos

  • Newbie
  • Posts: 5
Re: Trouble using fpSock / TTcpClient
« Reply #7 on: October 13, 2018, 06:17:59 pm »
i deleted c:\fpc\ and c:\lazarus\
reinstalled lazarus (using lazarus-1.8.4-fpc-3.0.4-win32.exe)
after install, i found c:\lazarus\fcp\3.0.4\units\i386-win32\fcl-net\ssockets.ppu
but no fpSock.ppu anywhere

same result/error when compiling.

i also tried "fppgk update", but got the error: "HTTP Download of "http://www.freepascal.org:80/repository/mirrors.xml" failed: Moved Permanently"

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: Trouble using fpSock / TTcpClient
« Reply #8 on: October 13, 2018, 09:12:24 pm »
fcl-net is evolving all the time. I guess the unit you want is only available in a later revision.
The unit is present in fpc 3.3.1.


dbannon

  • Hero Member
  • *****
  • Posts: 2786
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Trouble using fpSock / TTcpClient
« Reply #9 on: October 14, 2018, 08:23:00 am »
fpsock.ppu is definitely present in my LINUX install of FPC304.  I'd be very surprised if its intentionally not there under windows.

Maybe you need to install FPC via another means ?  Its just (but only just) possible the install kit you used is malformed.

I don't have a 32bit Windows install so cannot check for you.

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

BrunoK

  • Sr. Member
  • ****
  • Posts: 452
  • Retired programmer
Re: Trouble using fpSock / TTcpClient
« Reply #10 on: October 14, 2018, 01:26:39 pm »
I don't have fpSock.ppu and my recompiled FPC 3.0.4 Win32 was rebuild on 07.10.2018.
It seems that fpSock (according to packages\fcl-net\fpmake.pp) is only for Linux variant of FPC.
Maybe replace fpSock with Sockets, that should find the correct .ppu and .o.

Note : I'm pretty ignorant in these matters.

 

TinyPortal © 2005-2018