Wednesday, 04 December 2019
  4 Replies
  1.5K Visits
  Subscribe
Hi,

I'm trying to recreate the sockets demo on Lazarus, let me first describe the environment I'm using: Lazarus trunk 1.9 (date 2019-11-05) FPC Version: 3.1.1 SVN Revision: 55740M, Windows 7 64 bits, Indy version ( the one included with sgc )

After creating the new project I'm adding the sgc source paths to project options, compiler options, other unit files :
..\sgcWebSockets_source_4_3_1\Source
..\sgcWebSockets_source_4_3_1\Lazarus\Indy

Then I'm adding to the uses :

, sgcWebSocket_Classes
, sgcWebSocket_Server_Sockets

Until here everything compiles just fine, next addition :

private
FConnection: TsgcWSConnection;

compiling ok, next addition :
FServer: TsgcWSServer_Sockets;

And no more joy, I'm getting the message:

Identifier not found "TsgcWSServer_Sockets"

I've downloaded the stable version of Lazarus just to find the very same error.

Then I have a Delphi 2007 installation on the same machine, it is not my intention to use sgc on delphi but I decided to give it a try, there is Indy 10.6 installed on this setup, I had to add the following changes to sgcVer.inc :

{$IFDEF VER185} { Delphi 2007 }
...
{$DEFINE INDY10_2}
{$DEFINE INDY10_5_7}
{$DEFINE INDY10_6}

and add the references to the correct indy packages to the dpk, so far so good, added the sgc source paths to Tools - Options - Environment Options - Delphi options - Library - Libraryu Path, then trying to compile the same code as mentioned above I'm getting :

E2003 Undeclared identifier: 'TsgcWSServer_Sockets'

Basically the same error, I don't know why it happens because I can see the class defined in unit sgcWebSocket_Server_Sockets

Does anybody else has found this issue ? How did you overcome it ?

P.S. I have access to machines with Delphi XE and Delphi XE3, maybe I can compile over there and it will work but I need it working on Lazarus, D2007 will be a plus.