Sometimes you may get some errors installing components.
sgcWebsockets is compiled using the default Intraweb version provided with Delphi. If you don't have Intraweb installed, you can modify sgcVer.inc file (located in Source folder).
Search your Delphi version and comment all compiler defines for Intraweb (starts with IW). Example: for Delphi 10.4 comment all compiler defines for Intraweb
{$IFDEF VER340} { Delphi 10.4 }
{$DEFINE D2006}
{$DEFINE D2007}
{$DEFINE D2009}
{$DEFINE D2010}
{$DEFINE DXE}
{$DEFINE DXE2}
{$DEFINE DXE3}
{$DEFINE DXE4}
{$DEFINE DXE5}
{$DEFINE DXE6}
{$DEFINE DXE7}
{$DEFINE DXE8}
{$DEFINE D10}
{$DEFINE D10_1}
{$DEFINE D10_2}
{$DEFINE D10_3}
{$DEFINE D10_4}
{$DEFINE INDY10_1}
{$DEFINE INDY10_2}
{$DEFINE INDY10_5_5}
{$DEFINE INDY10_5_7}
{$DEFINE INDY10_5_8}
{$DEFINE INDY10_6}
{$DEFINE INDY10_6_0_5122}
{$DEFINE INDY10_6_0_5169}
{$DEFINE INDY10_6_2_5263}
{$DEFINE INDY10_6_2_5366}
{$DEFINE INDY10_6_2_D10_4}
{$IFNDEF BCB}
{$IFNDEF MACOS}
{$IFNDEF ANDROID}
{.$DEFINE IWIX}
{.$DEFINE IWXI}
{.$DEFINE IWXIV}
{.$DEFINE IWXV}
{$ENDIF}
{$ENDIF}
{$IFNDEF NEXTGEN}
{$DEFINE SGC_JSON_INTF}
{$ENDIF}
{$ENDIF}
{$ENDIF}
If Intraweb is installed but it's a different version from the default that comes with Delphi, maybe your Intraweb package has a different name. Then open sgcWebSockets runtime package and change Intraweb name in project source.
sgcWebSockets requires Indy to install components in your IDE. Trial installation is compiled against Indy library provided with Delphi / CBuilder, so if you get a message like this:
[DCC Fatal Error] dclsgcWebSocketsDX.dpk(31): E2202 Required package 'IndyCore' not found
Most probably you have a newer Indy version, so in order to install trial you must delete this version and install built-in indy version using Delphi / CBuilder setup.
If you have full source code, then you only must check:
1. Required Indy packages: IndyCore, IndySystem and IndyProtocols. If you have a newer Indy version, most probably packages have a different name (including version), so access to menu "Component / Install Packages" and check which name have Indy packages and change accordingly in the project.
2. sgcWebSockets supports several Indy versions, there are compiler defines to allow compile for every Indy version. Open sgcVer.inc, located in the source folder, and change accordingly for your Indy version (is gsIdVersion of IdVers.inc Indy file). Some compiler defines:
{$DEFINE INDY10_1}
{$DEFINE INDY10_2}
{$DEFINE INDY10_5_5}
{$DEFINE INDY10_5_7}
{$DEFINE INDY10_5_8}
{$DEFINE INDY10_6}
{$DEFINE INDY10_6_0_5122}
{$DEFINE INDY10_6_0_5169}
{$DEFINE INDY10_6_2_5263}
{$DEFINE INDY10_6_2_5366}
{$DEFINE INDY10_6_2_D10_4}
If you compile a project using CBuidler and you get this error, set the following options in your project:
Project > Options > C++ Linker
uncheck "Link with Dynamic RTL"
Project > Options > Packages > Runtime Packages
uncheck "Link with runtime packages"
When you compile runtime package for win64, you must compile Release and Debug.
sgcWebSockets Standard and Professional uses Indy for some components and Indy doesn't make use of ZLib unit, uses its own copy of ZLib: IdZLib, IdZLibHeaders... the project is linking to ZLib and indy ZLib units, so when compile, compiler doesn't know which is the correct reference because names are the same. There are 2 solutions:
1. Search where is included a link to System.ZLib.hpp and delete or move after IdZLibHeaders.hpp
2. Use the following conditional defines NO_USING_NAMESPACE_SYSTEM_ZLIB or DELPHIHEADER_NO_IMPLICIT_NAMESPACE_USE in your projects options to avoid the use of System.Zlib.hpp
sgcWebSockets Enterprise uses a custom Indy version for some components and Indy doesn't make use of ZLib unit, uses its own copy of ZLib: sgcIdZLib, sgcIdZLibHeaders... the project is linking to ZLib and indy ZLib units, so when compile, compiler doesn't know which is the correct reference because names are the same. There are 2 solutions:
1. Search where is included a link to System.ZLib.hpp and delete or move after sgcIdZLibHeaders.hpp
2. Use the following conditional defines NO_USING_NAMESPACE_SYSTEM_ZLIB or DELPHIHEADER_NO_IMPLICIT_NAMESPACE_USE in your projects options to avoid the use of System.Zlib.hpp
Use the following workarround to fix the error. Add the file libsgcwebsocketsC*.a which is located in the dcp/android default folder to your project using the menu "Project/ Add to Project".
Example: for CBuilder 11, add to your project the file "libsgcWebSocketsC11.a" which is located by default in the folder "C:\Users\Public\Documents\
This error can be raised while trying to install the components under Lazarus if the profile to build the IDE is not "Optimized IDE". The trial is compiled with the profile "Optimized IDE".
Try the following workarround "Run / Clean up and rebuild" from the menu option.