[fpc-devel] resource compilation fails, if cpp is not on the path

Yury Sidorov jura at cp-lab.com
Thu Sep 27 16:41:32 CEST 2007


From: "Vincent Snijders" <vsnijders at quicknet.nl>
> Consider the following application:
>
> program rescomp;
>
> {$R lazarus.rc}
>
> begin
> end.
>
> If I have an empty path variable and I call the compiler with an 
> absolute path, it fails, see below. The solution would be to add 
> the --preprocessor parameter to windres, as is done below. The 
> cpp.exe should be located in the same directory as windres. How can 
> this be done?
>
> Vincent
>
> D:\lazarus\bugs\rescomp>SET PATH=
>
> D:\lazarus\bugs\rescomp>d:\fpc\2.3.1\bin\i386-win32\fpc rescomp.pas
> Free Pascal Compiler version 2.3.1 [2007/07/12] for i386
> Copyright (c) 1993-2007 by Florian Klaempfl
> Target OS: Win32 for i386
> Compiling rescomp.pas
> Compiling resource lazarus.rc
> gcc: installation problem, cannot exec `cpp': No such file or 
> directory
> d:\FPC\2.3.1\bin\i386-win32\windres.exe: no resources
> rescomp.pas(6,1) Error: Error while linking
> rescomp.pas(6,1) Fatal: There were 1 errors compiling module, 
> stopping
> Fatal: Compilation aborted
> Error: d:\fpc\2.3.1\bin\i386-win32\ppc386.exe returned an error 
> exitcode (normal
>  if you did not specify a source file to be compiled)
>
> D:\lazarus\bugs\rescomp>d:\fpc\2.3.1\bin\i386-win32\windres 
> lazarus.rc lazarus.r
> es
> gcc: installation problem, cannot exec `cpp': No such file or 
> directory
> d:\fpc\2.3.1\bin\i386-win32\windres: no resources
>
> D:\lazarus\bugs\rescomp>d:\fpc\2.3.1\bin\i386-win32\windres --preprocessor=d:\fp
> c\2.3.1\bin\i386-win32\cpp.exe lazarus.rc lazarus.res

Yes. It is known issue. Compiler can search for "cpp" tool the same 
way as other tools like "as", "ld" and then pass --preprocessor switch 
to windres if "cpp" was found.

Yury. 



More information about the fpc-devel mailing list