RTC Forums
May 15, 2024, 04:20:32 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: FPC/Lazarus compilation issues  (Read 3920 times)
Max Terentiev
RTC License
***
Posts: 49


« on: June 04, 2017, 01:38:01 PM »

Hi Danijel,

Please add following fixes to eleminate compilation problems under FPC/Lazarus

1. FpcApi.inc

Please change declaration of this functions:

function WSA_GetSockName(s: TSocket; var name: TSockAddr): Integer;   
function WSA_GetPeerName(s: TSocket; var name: TSockAddr): Integer;

to

function WSA_GetSockName(s: TSocket; var name: TSockAddr; PreferIP4:Boolean): Integer;   
function WSA_GetPeerName(s: TSocket; var name: TSockAddr; PreferIP4:Boolean): Integer;

PreferIP4 parameter must be added because it's used while calling this functions from rtcSynApi.pas

2. rtcTypes.pas

Please change

Code:
{$IFDEF UNICODE}
  // @exclude
  RtcBinWideChar = Word;
  // Unicode String
  RtcWideString = String;
  // Unicode character
  RtcWideChar = Char;
{$ELSE}
  // @exclude
  RtcBinWideChar = Word;
  // Unicode String
  RtcWideString = WideString;
  // Unicode character
  RtcWideChar = WideChar;
{$ENDIF}

to

Code:
{$IFDEF UNICODE}
  // @exclude
  RtcBinWideChar = Word;
  // Unicode String
  RtcWideString = String;
  // Unicode character
  RtcWideChar = Char;
{$ELSE}
  {$IF DEFINED(FPC) AND DEFINED(VER3)} // FPC 3.0 have unicode support
  // @exclude
  RtcBinWideChar = Word;
  // Unicode String
  RtcWideString = String;
  // Unicode character
  RtcWideChar = Char;
  {$ELSE}
  // @exclude
  RtcBinWideChar = Word;
  // Unicode String
  RtcWideString = WideString;
  // Unicode character
  RtcWideChar = WideChar;
  {$ENDIF}
{$ENDIF} 

This changes needed to eleminate hundreds warnings like Implicit string type conversion with potential data loss from "WideString" to "AnsiString", AnsiString to WideString, UnicodeString to AnsiString and so on.

3. rtcInfo.pas->function GetTickTime:Cardinal;

Change

Result := fpTimes(b)*10;

to

Result := Cardinal(fpTimes(b)*10);

This change eleminate Range error exception on start of app.

After this changes RTC compiles in Lazarus 1.6.4 and FPC 3.0.2 and Quick Start\Lazarus_Server demo works on both Windows64 and Linux64.

And one final note:

In Quick Start\Lazarus_Server demo please add RtcHttpServer.StopListenNow(); in form's OnClose. Without this line access violation occurs on closing demo app.
Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #1 on: June 05, 2017, 10:29:56 AM »

Please, download RTC SDK v8.07 (just released) and let me know if this version works for you on Windows and Linux, when compiled with the Lazarus and FPC version you are using. Thanks.

Best Regards,
Danijel Tkalcec
Logged
Max Terentiev
RTC License
***
Posts: 49


« Reply #2 on: June 05, 2017, 07:36:59 PM »

It's MUCH better now ! Thanks !

Currently it's compiles with no problems for Win64 and Linux64

Simple demos and tasks like calling remote functions works on both platforms.

Continue testing....
Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #3 on: June 06, 2017, 07:19:33 AM »

Thanks.

Best Regards,
Danijel Tkalcec
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.023 seconds with 17 queries.