简体   繁体   中英

Compiling GMLib 1.1.0 in XE5

I managed to solve several issues and install the "GMLib_DXE4.bpl".

Now I have two problems with compiling "GMLib_DXE4_VCL.bpl".

[dcc32 Error] GMMapVCL.pas(124): E2003 Undeclared identifier: 'TTimer'

[dcc32 Error] WebControlVCL.pas(180): E2029 Identifier expected but 'IMPLEMENTATION' found : Solved.

Regarding TTimer:

    uses
  {$IFDEF WEBBROWSER}
  SHDocVw,
    {$IFDEF DELPHIXE2}
    Vcl.ExtCtrls,
    {$ELSE}
    ExtCtrls,
    {$ENDIF}
  {$ENDIF}

  {$IFDEF CHROMIUM}
  cefvcl, ceflib, cefgui,
  {$ENDIF}

  {$IFDEF DELPHIXE2}
  System.SysUtils, System.Classes, Vcl.Dialogs, Vcl.Graphics,
  {$ELSE}
  SysUtils, Classes, Dialogs, Graphics,
  {$ENDIF}

  GMMap, GMFunctionsVCL;

Regarding implementation: Solved.

    unit WebControlVCL;

    {.$DEFINE WEBBROWSER}
    {.$DEFINE CHROMIUM}
    {$I ..\gmlib.inc}

    interface

    uses
      {$IFDEF WEBBROWSER}
      MSHTML, SHDocVw,
      {$ENDIF}

      {$IFDEF CHROMIUM}
      ceflib, cefvcl,
      {$ENDIF}

      {$IFDEF DELPHIXE2}
      System.SysUtils,
      {$ELSE}
      SysUtils,
      {$ENDIF}

      WebControl;

    type
       -------------------------------------------------------------------------------}
      {$IFDEF WEBBROWSER}
      TWebControl = class(TCustomWeb)
      protected    
        function WebFormGet(const FormNumber: Integer): IHTMLFormElement;
        function WebFormFieldValue(const FormIdx: Integer; const FieldName: string): string; overload; override;
      public
         constructor Create(WebBrowser: TWebBrowser); reintroduce; virtual;
         .....
      end;
      {$ENDIF}

      {$IFDEF CHROMIUM}
      TWebChromium = class(TCustomWebChromium)
      protected
        function WebFormFieldValue(const FormIdx: Integer; const FieldName: string): string; overload; override;
      public
        constructor Create(WebBrowser: TChromium); reintroduce; virtual;
        .....
      end;
      {$ENDIF}

implementation

    uses
      {$IFDEF WEBBROWSER}
        {$IFDEF DELPHIXE2}
        Winapi.ActiveX, System.Types, Vcl.Graphics, Vcl.Forms, System.StrUtils,
        {$ELSE}
        ActiveX, Types, Graphics, Forms, StrUtils,
        {$ENDIF}
      {$ENDIF}

      {$IFDEF DELPHIXE2}
      Vcl.Imaging.jpeg, System.DateUtils;
      {$ELSE}
      jpeg, DateUtils;
      {$ENDIF}

    { TWebControl }

    {$IFDEF WEBBROWSER}
    constructor TWebControl.Create(WebBrowser: TWebBrowser);
    begin
      inherited Create(WebBrowser);
    end;

You are using an out of date version of GMLib. As a general rule, never download the pre-packaged version of an open source project. Developers have a habit of not updating these pre-packaged downloads as frequently as you might like.

Instead, always go to the revision control repository to get the latest version. In this case it is here: https://code.google.com/p/gmlibrary/source and does appear to have been updated to support XE5.

FWIW your problem could almost certainly have been solved by way of a simple modification to the include file gmlib.inc. That file needs to be made aware of the new version. Take a look at the diffs for the latest revision for that file: https://code.google.com/p/gmlibrary/source/diff?spec=svn142&r=127&format=side&path=/trunk/gmlib.inc&old_path=/trunk/gmlib.inc&old=116

As you can see, all that is needed is to follow the pattern established for the other versions and add defines for XE5.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM