HtmlViewer icon indicating copy to clipboard operation
HtmlViewer copied to clipboard

Build Error with Lazarus 2.0.10 in Linux

Open mmvisualgit opened this issue 5 years ago • 1 comments

Version HtmlViewer V11.9.

See Picture.

Bild1

Thank you very much.

mmvisualgit avatar Nov 27 '20 21:11 mmvisualgit

Same here...

PDeviceInfoW normally comes from the Windows unit. For Linux compilation HtmlViewer defines its own versions, alas just a PDeviceInfoA and not the required PDeviceInfoW.

I just added the missing definitions to HtmlMisc.pas:

  _devicemodeW   = record
    dmDeviceName   : array[0.. CCHDEVICENAME-1] of WCHAR;
    dmSpecVersion  : WORD;
    dmDriverVersion: WORD;
    dmSize        : WORD;
    dmDriverExtra  : WORD;
    dmFields       : DWORD;
    dmOrientation  : short;
    dmPaperSize    : short;
    dmPaperLength  : short;
    dmPaperWidth   : short;
    dmScale       : short;
    dmCopies      : short;
    dmDefaultSource: short;
    dmPrintQuality : short;
    dmColor       : short;
    dmDuplex      : short;
    dmYResolution  : short;
    dmTTOption    : short;
    dmCollate     : short;
    dmFormName     : array [0..CCHFORMNAME-1] of wchar;
    dmLogPixels    : WORD;
    dmBitsPerPel   : DWORD;
    dmPelsWidth    : DWORD;
    dmPelsHeight   : DWORD;
    dmDisplayFlags : DWORD;
    dmDisplayFrequency     : DWORD;
    dmICMMethod    : DWORD;
    dmICMIntent    : DWORD;
    dmMediaType    : DWORD;
    dmDitherType   : DWORD;
    dmReserved1    : DWORD;
    dmReserved2    : DWORD;
    dmPanningWidth : DWORD;
    dmPanningHeight: DWORD;
  end;

  TDeviceModeW = _devicemodeW;
  PDeviceModeW = ^TDeviceModeW;   

For a proper fix I guess there should be an additional

{$ifdef Unicode}
  TDeviceMode = TDeviceModeW;
  PDeviceMode = PDeviceModeW;
{$else}
  TDeviceMode = TDeviceModeA;
  PDeviceMode = PDeviceModeA;
{$endif}

daniel-rikowski avatar Dec 28 '21 13:12 daniel-rikowski

Master branch compiles and runs with Lazarus 2.2 in Linux-MINT.

BerndGabriel avatar Jan 27 '23 16:01 BerndGabriel