Recent

Author Topic: Problems with LazBuild and windres  (Read 7489 times)

Kunstbanause

  • New Member
  • *
  • Posts: 47
Problems with LazBuild and windres
« on: January 28, 2009, 09:52:16 am »
Hi,

I suddenly get a strange error when I try to build project within the lazarus ide and when I try to build it using lazbuild. At first I thought it is a problem with windres as the error message is (using the IDE):
Code: [Select]
windres: preprocessing failed.
bla.lpr(20,1) Error: Error while compiling resources
bla.lpr(20,1) Fatal: There were 1 errors compiling module, stopping

But compiling the RC-file with windres worked without any errors.

Using lazbuild I get the following output:
Code: [Select]
> \dev\Lazarus\lazbuild.exe bla.lpi
TCompiler.Compile WorkingDir="Z:\Dev\Projekte\bla\" CompilerFilename="Z:\Dev\fpc\2.3.1\bin\i386-win32\fpc.exe" CompilerParams=" -MObjFPC -Sc
gi -O1 -gl -WG -vewnhi -l -Fu..\..\Lazarus\lcl\units\i386-win32\ -Fu..\..\Lazarus\lcl\units\i386-win32\win32\ -Fu..\..\Lazarus\packager\unit
s\i386-win32\ -Fu. -obla.exe -dLCL -dLCLwin32 bla.lpr"
[TCompiler.Compile] CmdLine="Z:\Dev\fpc\2.3.1\bin\i386-win32\fpc.exe  -MObjFPC -Scgi -O1 -gl -WG -vewnhi -l -Fu..\..\Lazarus\lcl\units\i386-
win32\ -Fu..\..\Lazarus\lcl\units\i386-win32\win32\ -Fu..\..\Lazarus\packager\units\i386-win32\ -Fu. -obla.exe -dLCL -dLCLwin32 bla.lpr"
Hint: Start of reading config file Z:\Dev\fpc\2.3.1\bin\i386-win32\fpc.cfg
Hint: End of reading config file Z:\Dev\fpc\2.3.1\bin\i386-win32\fpc.cfg
Free Pascal Compiler version 2.3.1 [2009/01/28] for i386
Copyright (c) 1993-2008 by Florian Klaempfl
Target OS: Win32 for i386
Compiling bla.lpr
Compiling resource Z:\Dev\Projekte\bla\bla.rc
Z:\Dev\MinGW\bin\windres.exe: preprocessing failed.
bla.lpr(20,1) Error: Error while compiling resources
bla.lpr(20,1) Fatal: There were 1 errors compiling module, stopping
ERROR: failed compiling of project Z:\Dev\Projekte\bla\bla.lpi


Then I used the compiler commandline on I found in the lazbuild output and I got a surprise:
Code: [Select]
> Z:\Dev\fpc\2.3.1\bin\i386-win32\fpc.exe  -MObjFPC -Scgi -O1 -gl -WG -vewnhi -l -Fu..\..\Lazarus\lcl\units\i386-win32\ -Fu..\..\Lazarus\lcl
\units\i386-win32\win32\ -Fu..\..\Lazarus\packager\units\i386-win32\ -Fu. -obla.exe -dLCL -dLCLwin32 bla.lpr
Hint: Start of reading config file Z:\Dev\fpc\2.3.1\bin\i386-win32\fpc.cfg
Hint: End of reading config file Z:\Dev\fpc\2.3.1\bin\i386-win32\fpc.cfg
Free Pascal Compiler version 2.3.1 [2009/01/28] for i386
Copyright (c) 1993-2008 by Florian Klaempfl
Target OS: Win32 for i386
Compiling bla.lpr
Compiling resource Z:\Dev\Projekte\bla\bla.rc
Compiling resource bla.or
Linking bla.exe
5243 lines compiled, 2.2 sec , 1227408 bytes code, 475352 bytes data
2 hint(s) issued

Suddenly it worked. But only when I do not use the IDE or lazbuild.

"bla" is an empty application created by the "New Application" template.

SVN revision of fpc: 12620
SVN revision of lazarus: 18467

Vincent Snijders

  • Administrator
  • Hero Member
  • *
  • Posts: 2661
    • My Lazarus wiki user page
Re: Problems with LazBuild and windres
« Reply #1 on: January 28, 2009, 10:00:28 am »
Can you try to compile the project with the -vd parameter, I think it will show how the compiler calls windres exactly.

Bart

  • Hero Member
  • *****
  • Posts: 5290
    • Bart en Mariska's Webstek
Re: Problems with LazBuild and windres
« Reply #2 on: January 28, 2009, 11:41:10 am »
I noticed this:
You start from here:
> \dev\Lazarus\
and it calls
Z:\Dev\MinGW\bin\windres.exe
and fails

You start from here:
Z:\Dev\fpc\2.3.1\bin\i386-win32\
and windres succeeds.

Is it possible that in the last case the actual windres.exe is in Z:\Dev\fpc\2.3.1\bin\i386-win32\ (the one that came with Lazarus or fpc) and the first one is a different one?

Bart

Kunstbanause

  • New Member
  • *
  • Posts: 47
Re: Problems with LazBuild and windres
« Reply #3 on: January 28, 2009, 01:21:19 pm »
I noticed this:
You start from here:
> \dev\Lazarus\
and it calls
Z:\Dev\MinGW\bin\windres.exe
and fails

You start from here:
Z:\Dev\fpc\2.3.1\bin\i386-win32\
and windres succeeds.

Is it possible that in the last case the actual windres.exe is in Z:\Dev\fpc\2.3.1\bin\i386-win32\ (the one that came with Lazarus or fpc) and the first one is a different one?

Bart
I only do have the windres installed in the Z:\Dev\MinGW\bin\windres.exe directory (which is in my $PATH). After I installed MinGW I moved all files that won't get built with the source code to the MinGW directory (and deleted those which already came with MinGW).

Can you try to compile the project with the -vd parameter, I think it will show how the compiler calls windres exactly.
I did. But there's no difference in the command lines (I attached the output)

yuriy_sydorov

  • Full Member
  • ***
  • Posts: 158
Re: Problems with LazBuild and windres
« Reply #4 on: January 30, 2009, 04:40:48 pm »
Do you have windres.h file in Z:\Dev\MinGW\bin\?
If yes, make sure it is the same as Z:\Dev\fpc\2.3.1\bin\i386-win32\windres.h

Kunstbanause

  • New Member
  • *
  • Posts: 47
Re: Problems with LazBuild and windres
« Reply #5 on: February 02, 2009, 10:15:42 am »
Do you have windres.h file in Z:\Dev\MinGW\bin\?
If yes, make sure it is the same as Z:\Dev\fpc\2.3.1\bin\i386-win32\windres.h
I do not have any windres.h on my hdd. And on another computer I do not have it either but there I can compile my projects with lazbuild without getting any error by windres.

One interesting thing is, when I call lazbuild using tcc.exe by JP Software instead of cmd.exe I do not get any error either. But that's not an option as I do have to run lazarus from tcc too (a double click on startlazarus.exe or lazarus.exe end with an error too) for not getting an error while compiling a project. I compared the environment of tcc.exe and cmd.exe and they are both the same.

 

TinyPortal © 2005-2018