Skip to content

Compile issue on Delphi 12 with ifndefs #12

Description

@SkybuckFlying

Problem with last line:

{###############################################################################
                      https://github.com/wendelb/DelphiOTP
###############################################################################}
unit GoogleOTP;

{$IFDEF FPC}
{$mode objfpc}{$H+}
{$ENDIF}

interface

uses
  {$IFNDEF FPC}System.{$ENDIF}SysUtils, {$IFNDEF FPC}System.{$ENDIF}Math, Base32U, {$IFNDEF FPC}System.{$ENDIF}DateUtils
  {$IFNDEF FPC}

[dcc32 Error] GoogleOTP.pas(13): E2029 Identifier expected but end of file found
[dcc32 Error] GoogleOTP.pas(13): E2029 Identifier expected but end of file found
[dcc32 Error] Base32U.pas(22): E2029 Identifier expected but end of file found
[dcc32 Error] Base32U.pas(55): E2003 Undeclared identifier: 'UpperCase'
[dcc32 Fatal Error] GoogleOTP.pas(13): F2063 Could not compile used unit 'Base32U.pas'

I will try to fix it myself but first I or copilot must understand what the problem is, it's kinda weird ! ;) =D

(Thanks btw for writing a small little app, saves me some time, I hope it's compatible with winotp and google authenticator ! ;) then I can compile/build this and hopefully this app will then work on windows 7, unlike all the other crap out there ! =D)

Activity

  1. SkybuckFlying commented on Mar 12, 2024

    @SkybuckFlying
    Author

    Fixed it for you:

    uses
    (*
      {$IFNDEF FPC}System.{$ENDIF}SysUtils, {$IFNDEF FPC}System.{$ENDIF}Math, Base32U, {$IFNDEF FPC}System.{$ENDIF}DateUtils
      {$IFNDEF FPC}
    	, IdGlobal, IdHMACSHA1
      {$ELSE}
    	, HMAC
      {$IFEND};
    *)
    
      Base32U,
    
      {$IFDEF FPC}
      SysUtils,
      Math,
      DateUtils
      {$ELSE}
      System.SysUtils,
      System.Math,
      System.DateUtils,
      {$IFEND}
    
      {$IFNDEF FPC}
      IdGlobal,
      IdHMACSHA1
      {$ELSE}
      , HMAC
      {$IFEND};
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions