Search code examples
winapifreepascallazarus

WinAPI functions in Free Pascal Lazarus 1.0.2 (FPC 2.6.0)


I'm trying to compile a Delphi project in Free Pascal Lazarus and get compiler errors, because several WinAPI functions (CreateNamedPipe, GetLastError, OutputDebugString) can't be found.

The uses clause of the file in question looks like this:

uses
  SysUtils,
  LCLIntf, LCLType, LMessages;

Which units should I add to the uses clause in order to fix the aforementioned compiler errors?


Solution

  • You need the Unit Windows for the WinAPI.

    uses SysUtils, LCLIntf, LCLType, LMessages, Windows;