Recent

Author Topic: Error: Cannot find fpsock used by MainForm of the Project Inspector  (Read 606 times)

daniel_sap

  • Full Member
  • ***
  • Posts: 115
Hi, I'm trying to use TTCPClient from fcl-net but got this error
Error: Cannot find fpsock used by MainForm of the Project Inspector.

Should I install some extra package
Is it a good idea to use it at all or its better to go for 3rd party implementations.

Lazarus 4.0RC1 (rev t-fixes-4-58-g43d904ed50) FPC 3.2.2 x86_64-win64-win32/win64

Code: Pascal  [Select][+][-]
  1. unit MainForm;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. interface
  6.  
  7. uses
  8.   Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ExtCtrls;
  9.  
  10. type
  11.  
  12.   { TForm1 }
  13.  
  14.   TForm1 = class(TForm)
  15.     btnSend: TButton;
  16.     Memo1: TMemo;
  17.     Panel1: TPanel;
  18.     procedure btnSendClick(Sender: TObject);
  19.   private
  20.  
  21.   public
  22.  
  23.   end;
  24.  
  25. var
  26.   Form1: TForm1;
  27.  
  28. implementation
  29.  
  30. uses
  31.   fpsock;
  32.  
  33. {$R *.lfm}
  34.  
  35. { TForm1 }
  36.  
  37. procedure TForm1.btnSendClick(Sender: TObject);
  38. var
  39.   Client: TTCPClient;
  40. begin
  41.   Client := TTCPClient.Create;
  42.  
  43. end;
  44.  
  45. end.
  46.  
« Last Edit: September 04, 2025, 11:32:03 am by daniel_sap »

Thausand

  • Sr. Member
  • ****
  • Posts: 498
Re: Error: Cannot find fpsock used by MainForm of the Project Inspector
« Reply #1 on: September 04, 2025, 03:44:50 am »
Hi, I'm trying to use TTCPClient from fcl-net but got this error
Error: Cannot find fpsock used by MainForm of the Project Inspector.

Lazarus 4.0RC1 (rev t-fixes-4-58-g43d904ed50) FPC 3.2.2 x86_64-win64-win32/win64

fpsock is linux unit afaik.

Quote
Is it a good idea to use it at all or its better to go for 3rd party implementations.

If fpsock not for windows, then yes need 3rd party
« Last Edit: September 04, 2025, 04:19:48 am by Thausand »

Thaddy

  • Hero Member
  • *****
  • Posts: 18924
  • Glad to be alive.
Re: Error: Cannot find fpsock used by MainForm of the Project Inspector
« Reply #2 on: September 04, 2025, 07:09:18 am »
There must be something else going on. But fpsock is unix, that is correct.

The code seems not written for fcl-net's fpsock.TTcpClient, because several methods and properties in the above code do not exist in TTcpClient from fpsock.

Looks more like Delphi's old TTcpClient? (Which has been deprecated since D7)

The cross-platform TCP client in fcl-net is TInetSocket in the ssockets unit.
« Last Edit: September 04, 2025, 08:42:47 am by Thaddy »
Recovered from removal of tumor in tongue following tongue reconstruction with a part from my leg.

daniel_sap

  • Full Member
  • ***
  • Posts: 115
Re: Error: Cannot find fpsock used by MainForm of the Project Inspector
« Reply #3 on: September 04, 2025, 11:41:37 am »
Thank you, Thausand and Thaddy

To summarize
- fpsock unit is specific for unix, linux
- ssockets unit contains the cross-platform TCP client TInetSocket
- both of them are part of fcl-net package

The code seems not written for fcl-net's fpsock.TTcpClient, because several methods and properties in the above code do not exist in TTcpClient from fpsock.

Looks more like Delphi's old TTcpClient? (Which has been deprecated since D7)
I reduced the example code, not to confuse someone reading this in the future.

 

TinyPortal © 2005-2018