VMP 3.0.7 - MAC OSX

I am trying to protect a firemonkey application (Win32/Win64/OSX).
I include like I usually do vmprotectsdk in the uses list. Works as it should when compiling for win32/win64, but when I switch to OSX as target, I get an error that “VMProtectDLLName” is unknown in vmprotectsdk.
So how can I compile a MAC OSX app using vmprotectsdk?

Try VMProtect.pas from the attachment.
VMProtectSDK.zip (1.44 KB)

Its the same, when OSX as target is selected, I get:

[dccosx Error] VMProtectSDK.pas(100): E2003 Undeclared identifier: ‘VMProtectDLLName’

The line with the first error is this:

procedure VMProtectBegin(MarkerName: PAnsiChar); {$IFDEF MACOSX} cdecl {$ELSE} stdcall {$ENDIF}; external {$IFNDEF DARWIN}VMProtectDLLName{$ENDIF} {$IFDEF MACOS} name ‘_VMProtectBegin’{$ENDIF};

which means that darwin is not defined.

Delphi is very strange compiler :slight_smile:) Try this:

{$IFDEF WIN64}
  const VMProtectDLLName = 'VMProtectSDK64.dll';
{$ELSE}
{$IFDEF WIN32}
  const VMProtectDLLName = 'VMProtectSDK32.dll';
{$ELSE}
{$IFDEF MACOSX}
  {$IFDEF DARWIN}
    {$LINKLIB libVMProtectSDK.dylib}
  {$ELSE}
    const VMProtectDLLName = 'libVMProtectSDK.dylib';
  {$ENDIF}
{$ELSE}
  {$FATAL Unsupported OS!!!}
{$ENDIF}
{$ENDIF}
{$ENDIF}

Is it OK now?