cannot use ActiveX or Variant packages ?

Issue #91 resolved
Vincent Grillot created an issue

Hi,
I'm new with I-pascal, but it looks very promising to use the IDEA editor to make some delphi.

I have something like path issue, and as I'm pretty sure it's a config matter, I wish I didn't report it as an issue.

I'm running windows, using ultimate version of IDEA, and Delphi 10.3 (v33, studio 20.0)

I cannot import System.Variants or Winapi.ActiveX.

here a sample code:

program test;

uses
  Winapi.ActiveX;

begin
  writeln('hello world');
end.

The path ....\source\rtl\sys where the file .pas is present is already included in project structure > platform settings > sdk > classpath.

All other fields in general tabsheet are left empty but "additional compiler options" filled with "-dWINDOWS -dWIN32 "

I might missed something obvious, but cannot point it !

Thanks for any help,
Vincent.

Comments (6)

  1. George

    I don’t understand what the problem is.

    Are the units in uses clause marked as error or completion don’t offer identifiers from them?

    In that case try do File->Invalidate caches / Restart.

    I’ve checked these units and both are parsed well.

  2. Vincent Grillot reporter

    Hi George,

    The code completion looks good, and the unit is found if I want to navigate it.

    But I can’t compile if I use “Winapi.ActiveX” with this message:

    Build completed with 1 error and 423 warnings in 3 s 669 ms

    Warning:(7565, -1) Pascal builder: W1002 Symbol 'DELAYED' is specific to a platform
    Warning:(7566, -1) Pascal builder: W1002 Symbol 'DELAYED' is specific to a platform
    Warning:(7567, -1) Pascal builder: W1002 Symbol 'DELAYED' is specific to a platform
    Warning:(7568, -1) Pascal builder: W1002 Symbol 'DELAYED' is specific to a platform
    Warning:(7569, -1) Pascal builder: W1002 Symbol 'DELAYED' is specific to a platform
    Warning:(7570, -1) Pascal builder: W1002 Symbol 'DELAYED' is specific to a platform
    Warning:(7571, -1) Pascal builder: W1002 Symbol 'DELAYED' is specific to a platform
    Warning:(7572, -1) Pascal builder: W1002 Symbol 'DELAYED' is specific to a platform
    Warning:(7573, -1) Pascal builder: W1002 Symbol 'DELAYED' is specific to a platform
    Error:(7812, -1) Pascal builder: F1026 File not found: 'System.Variants'

    but the units are well referenced:

    Marbe there is a way to use the originals .dcu instead of recompiling system units ?

    Thanks for support,

    Vincent

    edit:fix typo

  3. Vincent Grillot reporter

    Hi again,

    I’m still struggling to have a compilation working AND units navigation.

    Here the used code for both tests:

    program test;
    
    {$APPTYPE CONSOLE}
    
    uses
      System.Variants;
    
    var
      v : Variant;
    
    begin
      v := 'test';
      writeln(v);
    end.
    

    On the first hand, there is no entry in project structure > sdks > delphi v33 > classpath or sourcepath.

    The build is fine, here the command line generated:

    Information:Pascal builder: Compiler command: C:\Program Files (x86)\Embarcadero\Studio\20.0\bin\dcc32.exe -dWINDOWS -dWIN32 -M -NC:\WORK\PROJECTS\Misc\IPascal\TestCompil\out\production\TestCompil -N0C:\WORK\PROJECTS\Misc\IPascal\TestCompil\out\production\TestCompil -EC:\WORK\PROJECTS\Misc\IPascal\TestCompil\out\production\TestCompil -UC:\WORK\PROJECTS\Misc\IPascal\TestCompil -IC:\WORK\PROJECTS\Misc\IPascal\TestCompil C:\WORK\PROJECTS\Misc\IPascal\TestCompil\test.dpr (Module: TestCompil)

    But the System.Variants is flagged as “undeclared identifier” in code view.

    On the second hand, I add C:\Program Files (x86)\Embarcadero\Studio\20.0\source\rtl\sys and then unit navigation is working, but it doesn’t compile anymore:

    Here the command line:

    Information:Pascal builder: Compiler command: C:\Program Files (x86)\Embarcadero\Studio\20.0\bin\dcc32.exe -dWINDOWS -dWIN32 -M -NC:\WORK\PROJECTS\Misc\IPascal\TestCompil\out\production\TestCompil -N0C:\WORK\PROJECTS\Misc\IPascal\TestCompil\out\production\TestCompil -EC:\WORK\PROJECTS\Misc\IPascal\TestCompil\out\production\TestCompil -UC:\WORK\PROJECTS\Misc\IPascal\TestCompil -IC:\WORK\PROJECTS\Misc\IPascal\TestCompil -UC:\Program Files (x86)\Embarcadero\Studio\20.0\source\rtl\sys -IC:\Program Files (x86)\Embarcadero\Studio\20.0\source\rtl\sys C:\WORK\PROJECTS\Misc\IPascal\TestCompil\test.dpr (Module: TestCompil)

    and the results:

    C:\Program Files (x86)\Embarcadero\Studio\20.0\source\rtl\sys\System.Variants.pas
    Error:(1271, -1) Pascal builder: E2158 System.Variants unit out of date or corrupted: missing '@VarCast'

    Any idea would be helpful.

    Thanks,

    Vincent.

  4. George

    There is two ways to solve this:

    Use DCU32INT decompiler.

    1. In project structure > sdks > delphi v33 > classpath add RTL DCUs.
    2. Download DCU32INT and set its path in SDK settings
    3. Do File->Invalidate caches/restart

    The second way also should work:

    1. In project structure > sdks > delphi v33 > classpath add RTL RTL DCUs as well as sources
    2. Compiler will get both paths and should use DCUs
  5. George Bakhtadze repo owner

    in v2.40 RTL units paths do not get passed to compiler as unit paths so it can be specified in SDK

  6. Log in to comment