AnsiString must be supported?

Issue #92 resolved
German Gentile
created an issue

I dont undertsand if AnsiString is compatible or dont with CrossVcl. I try a simple vcl form with a simple button:

procedure TForm2.Button1Click(Sender: TObject); var aString : AnsiString; begin aString := 'Holá'; Showmessage(aString); end;

[DCC Error] Unit2.pas(30): E2010 Incompatible types: 'Pointer' and 'string' [DCC Error] Unit2.pas(31): E2010 Incompatible types: 'string' and 'Pointer'

Comments (11)

  1. German Gentile reporter

    Eugene, In a delphi console app.

    This:

    var aString : AnsiString;

    Compile ok for win32 compiler.

    but Fail for linux compiler

    [DCC Error] Project3.dpr(12): E2003 Undeclared identifier: 'AnsiString'

    So, i understand you use the linux compiler on CrossVcl and then is not possible to support AnsiString. The problem is almost all the thirdy party developers and libraries stands on AnsiString. That is the response to your question on WHY to use AnsiStrings. I see a big problem comming here.

    Or im wrong?

  2. Eugene Kryukov repo owner

    AnsiString is not main issue with third-party i guest. There are lot of issues with old-vcl components and new Delphi compiler. Unfortunately we can't resolve it.

  3. German Gentile reporter

    Great news! Im trying to test now but for some reason my project havent Linux platffotm and the add new platform menu is not there anymore. With new projects is there. Seems like some flag in the projects becomes crazy? How to clean the old project config to allow to add again the linux plattform?

  4. German Gentile reporter

    Ok, now Ansistrings are recognized but seems like you must add the Winapi.Windows unit to the uses list. Not bideal at all, just to know, theres any global define i can use for crossvcl?

    Some like

    {$IFDEF CROSSVCL} Winapi.Windows {$ENDIF}

    Let me know.

  5. Log in to comment