Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2001-05

PPAS.BAT and directory paths with spaces in them

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Rich Pasco

Can anyone enlighten me as to the origin of PPAS.BAT ?

I'm using the released Free Pascal version 1.0.4 under Windows NT 4.0, compiling for a Win32 target. I use the stand-alone PPC386 compiler.

If source filename on the PPC386 command line includes a path with spaces in it, then the linker fails and leaves file PPAS.BAT on my disk. For example, the command line,

ppc386 "D:\memos\rich pasco\gentable.pas"

results in the output:

  Free Pascal Compiler version 1.0.4 [2000/12/30] for i386
  Copyright (c) 1993-2000 by Florian Klaempfl
  Target OS: Win32 for i386
  Compiling d:\memos\rich pasco\gentable.pas
  Linking d:\memos\rich pasco\gentable.exe
  -: cannot open pasco\gentable.exe: No such file or directory
  gentable.pas(47,1) Warning: Error while linking
  Closing script ppas.bat
  47 Lines compiled, 0.5 sec

The linker graciously leaves PPAS.BAT on my disk for inspection. A copy appears below. It seems obvious that the bug is in the fourth line: On the ldw command line, the output executable file name should have quotes around it.

In order to fix PPAS.BAT I need to know where it came from.

- Rich

--------------------- begin PPAS.BAT ----------------------------- @echo off
SET THEFILE=d:\memos\rich pasco\gentable.exe
echo Linking %THEFILE%
d:\pp\bin\win32\ldw.exe -s -b base.$$$ -o d:\memos\rich pasco\gentable.exe link.res if errorlevel 1 goto linkend
goto end
:asmend
echo An error occured while assembling %THEFILE%
goto end
:linkend
echo An error occured while linking %THEFILE%
:end
---------------------- end PPAS.BAT ------------------------------

Thomas Schatzl
to Rich Pasco
Can anyone enlighten me as to the origin of PPAS.BAT ?

This file is generated by the compiler and calls the external assembler and linker to create an executable out of the object code FPC creates. If this process fails, this file is left on the HD to be called by the user to complete the linking process.

In your case the linker fails because of the whitespace character in your path (this is partially the fault of the command shell). If you put quotation marks in front and after the '-o' parameter it should work fine.

E.g.:
d:\pp\bin\win32\ldw.exe -s -b base.$$$ -o "d:\memos\rich pasco\gentable.exe" link.res

Probably the compiler could be changed to do this automatically. Both the call to the linker (ldw) and the actual call to the linker should be put in quotation marks (so that fpc can be installed in directory with whitespaces in its name too).

Regards,
Thomas

Rich Pasco
Thomas Schatzl wrote
In your case the linker fails because of the whitespace character in your path (this is partially the fault of the command shell). If you put quotation marks in front and after the '-o' parameter it should work fine.

Yes, but how do I put quotation marks into a file that I don't write, but was written by the compiler for me?

Probably the compiler could be changed to do this automatically.

That would be my request.

- Rich