0
program Project1;

{$APPTYPE CONSOLE}

{$R *.res}

uses
  System.SysUtils;

begin
  try
    a := 1;
    { TODO -oUser -cConsole Main : Insert code here }
  except
    on E: Exception do
      Writeln(E.ClassName, ': ', E.Message);
  end;
end.

dcc32 'D:\workspace\Delphi\Testes\dcc-path\Nova pasta\Nova pasta\Nova pasta\Nova pasta\Nova pasta\Nova pasta\Nova pasta\Nova pasta\Nova pasta\Nova pasta\Project1.dpr'

When path of file is longer then 128, dcc truncates. The above error is outputed like this:

D:\workspace\Delphi\Tests\dcc-path\Nova pasta\Nova pasta\Nova pasta\Nova pasta\Nova pasta\Nova pasta\Nova pasta\Nova pasta\NovError: E2003 Undeclared identifier: 'a'

I dont see the full file name, neither the line number, in hints/warnings/errors. Is there a workaround for this?

Using Tokyo 10.2.

Rodrigo Caetano
  • 379
  • 1
  • 13
  • 3
    The obvious workaround is to use shorter paths or create directory junction via [mklink /J](https://ss64.com/nt/mklink.html) and open/compile the project from symbolic link. – Peter Wolf Dec 18 '20 at 17:34
  • mklink not available in powershell, solved using subst. Obvious, but had not thought it.Thanks – Rodrigo Caetano Dec 18 '20 at 18:09
  • The only not so good thing about this workaround is that Ctrl + Click does not go to file/line number anymore. I'm using this to automate compilation in vscode, using tasks. When the full file path is printed, ctrl click go to the file and line of the hint/warning/error. But at least I can see the file name and line number, and go manually – Rodrigo Caetano Dec 18 '20 at 18:13
  • 1
    Junctions created by `mklink` are permanent (until deleted). It does not necessarily need to be the part of PS script. And there are [ways to create symbolic links in PowerShell](https://stackoverflow.com/questions/894430/creating-hard-and-soft-links-using-powershell). – Peter Wolf Dec 18 '20 at 20:00

0 Answers0