Sign in Join

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

Mailing lists / lazarus / 2012-04

Error while compiling resources

12 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

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

Dave Coventry

I tried to take my project across to Windows and compile it there as my Linux Lazarus intall is borked, but I kept getting the above error whenever I tried to compile.

Google suggest that this is because of {$IFDEF WINDOWS}{$R lclimager.rc}{$ENDIF} however none of the incarnations of my Project uses that directive.

When I created a new project it compiled fine... until I saved it, after which the error occurred, even in a simple app with a blank form.

I'm running Lazarus 0.9.30.4 r35940 FPC 2.6.0 i386-win32-win32/win64 on XP in a Virtualbox VM.

Reply by email

Mattias Gaertner
to Dave Coventry

Dave Coventry hat am 16. April 2012 um 17:06 geschrieben:

Show quoted text 7 lines
I tried to take my project across to Windows and compile it there as my Linux Lazarus intall is borked, but I kept getting the above error whenever I tried to compile. Google suggest that this is because of {$IFDEF WINDOWS}{$R lclimager.rc}{$ENDIF} however none of the incarnations of my Project uses that directive.

Any $R directive requires the resource compiler fpcres.

Show quoted text 7 lines
When I created a new project it compiled fine... until I saved it, after which the error occurred, even in a simple app with a blank form. I'm running Lazarus 0.9.30.4 r35940 FPC 2.6.0 i386-win32-win32/win64 on XP in a Virtualbox VM.

Check if fpcres is in your PATH.

Mattias
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120416/3f8094d8/attachment.html>

Reply by email

Dave Coventry
to Mattias Gaertner

2012/4/16 Mattias Gaertner :

Any $R directive requires the resource compiler fpcres.

fpcres?

I don't know, I just installed from the exe I downloaded.

I have removed the $R directive and now it just fails without any error message.

Reply by email

Dave Coventry
to Dave Coventry

Hi Mattias,

Sorry, I was a bit rude (late) last night.

Thanks for the help. ;)

I have fpcres.exe installed in

C:\lazarus\fpc\2.6.0\bin\i386-win32

I have appended this onto my Path through My
Computer->Properties->Advanced->Environment Variables->System variables->Path
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\lazarus\fpc\2.6.0\bin\i386-win32

I'm still getting "Radmin.lpr(19,1) Error: Error while compiling resources"

Kind regards,

Dave

Dave Coventry wrote 8 lines
2012/4/16 Mattias Gaertner : > Any $R directive requires the resource compiler fpcres. fpcres? I don't know, I just installed from the exe I downloaded. I have removed the $R directive and now it just fails without any error message.

Reply by email

patspiper
to Dave Coventry
Dave Coventry wrote 30 lines
Hi Mattias, Sorry, I was a bit rude (late) last night. Thanks for the help. ;) I have fpcres.exe installed in C:\lazarus\fpc\2.6.0\bin\i386-win32 I have appended this onto my Path through My Computer->Properties->Advanced->Environment Variables->System variables->Path %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\lazarus\fpc\2.6.0\bin\i386-win32 I'm still getting "Radmin.lpr(19,1) Error: Error while compiling resources" Kind regards, Dave On 16 April 2012 22:30, Dave Coventry wrote: > 2012/4/16 Mattias Gaertner: >> Any $R directive requires the resource compiler fpcres. > fpcres? > > I don't know, I just installed from the exe I downloaded. > > I have removed the $R directive and now it just fails without any error message.

Did you check the project source (Radmin.lpr) for the $R directive (click Project/View project source)? Usually, the culprit is something like: {$IFDEF WINDOWS}{$R foobar.rc}{$ENDIF}

You can also check hidden messages by right clicking the messages window and selecting 'copy all shown and hidden messages to clipboard'

Stephano

Reply by email

Dave Coventry
to patspiper
patspiper wrote
Did you check the project source (Radmin.lpr) for the $R directive (click Project/View project source)? Usually, the culprit is something like: {$IFDEF WINDOWS}{$R foobar.rc}{$ENDIF}
8< 8< 8< 8< 8<8< 8< Radmin.lpr 8< 8< 8< 8< 8<
program Radmina;
{$mode objfpc}{$H+}

uses

  {$IFDEF UNIX}{$IFDEF UseCThreads}
  cthreads,
  {$ENDIF}{$ENDIF}
  Interfaces, // this includes the LCL widgetset
  Forms, radminunit
  { you can add units after this };
{$R *.res}
begin
  Application.Initialize;
  Application.CreateForm(TForm1, Form1);
  Application.Run;
end.
8< 8< 8< 8< 8<8< 8< 8< 8< 8<8< 8< 8< 8< 8<8<
You can also check hidden messages by right clicking the messages window and selecting 'copy all shown and hidden messages to clipboard'

Hint: Start of reading config file C:\lazarus\fpc\2.6.0\bin\i386-win32\fpc.cfg Hint: End of reading config file C:\lazarus\fpc\2.6.0\bin\i386-win32\fpc.cfg Free Pascal Compiler version 2.6.0 [2012/03/14] for i386 Copyright (c) 1993-2011 by Florian Klaempfl and others Target OS: Win32 for i386
Compiling Radmina.lpr
Compiling radminunit.pas
radminunit.pas(32,29) Hint: Parameter "Sender" not used Compiling resource
Z:\Projects\Delphi\Workflow\Revision\RevAdmin\lib\i386-win32\Radmina.or Radmina.lpr(19,1) Error: Error while compiling resources Linking Radmina.exe
Fatal: Compilation aborted

I start a new Project: Project->New Project->Application->OK

I run the New Project. It compiles without error.

I save the project to project1.lpi and unit1.pas

I now run it again. It fails with "project1.lpr(19,1) Error: Error
while compiling resources".

Hint: Start of reading config file C:\lazarus\fpc\2.6.0\bin\i386-win32\fpc.cfg Hint: End of reading config file C:\lazarus\fpc\2.6.0\bin\i386-win32\fpc.cfg Free Pascal Compiler version 2.6.0 [2012/03/14] for i386 Copyright (c) 1993-2011 by Florian Klaempfl and others Target OS: Win32 for i386
Compiling project1.lpr
Compiling unit1.pas
Compiling resource
Z:\Projects\Delphi\Workflow\Revision\RevAdmin\test\lib\i386-win32\project1.or project1.lpr(19,1) Error: Error while compiling resources Linking project1.exe
Fatal: Compilation aborted

Reply by email

Mattias Gaertner
to Dave Coventry
Show quoted text 47 lines
On 17 April 2012 18:21, patspiper wrote: > Did you check the project source (Radmin.lpr) for the $R directive (click > Project/View project source)? Usually, the culprit is something like: > {$IFDEF WINDOWS}{$R foobar.rc}{$ENDIF} 8< 8< 8< 8< 8<8< 8< Radmin.lpr 8< 8< 8< 8< 8< program Radmina; {$mode objfpc}{$H+} uses {$IFDEF UNIX}{$IFDEF UseCThreads} cthreads, {$ENDIF}{$ENDIF} Interfaces, // this includes the LCL widgetset Forms, radminunit { you can add units after this }; {$R *.res} begin Application.Initialize; Application.CreateForm(TForm1, Form1); Application.Run; end. 8< 8< 8< 8< 8<8< 8< 8< 8< 8<8< 8< 8< 8< 8<8< > You can also check hidden messages by right clicking the messages window and > selecting 'copy all shown and hidden messages to clipboard' Hint: Start of reading config file C:\lazarus\fpc\2.6.0\bin\i386-win32\fpc.cfg Hint: End of reading config file C:\lazarus\fpc\2.6.0\bin\i386-win32\fpc.cfg Free Pascal Compiler version 2.6.0 [2012/03/14] for i386 Copyright (c) 1993-2011 by Florian Klaempfl and others Target OS: Win32 for i386 Compiling Radmina.lpr Compiling radminunit.pas radminunit.pas(32,29) Hint: Parameter "Sender" not used Compiling resource Z:\Projects\Delphi\Workflow\Revision\RevAdmin\lib\i386-win32\Radmina.or Radmina.lpr(19,1) Error: Error while compiling resources Linking Radmina.exe Fatal: Compilation aborted I start a new Project: Project->New Project->Application->OK I run the New Project. It compiles without error.

It is saved to your temp directory and compiled there.

Show quoted text 17 lines
I save the project to project1.lpi and unit1.pas I now run it again. It fails with "project1.lpr(19,1) Error: Error while compiling resources". Hint: Start of reading config file C:\lazarus\fpc\2.6.0\bin\i386-win32\fpc.cfg Hint: End of reading config file C:\lazarus\fpc\2.6.0\bin\i386-win32\fpc.cfg Free Pascal Compiler version 2.6.0 [2012/03/14] for i386 Copyright (c) 1993-2011 by Florian Klaempfl and others Target OS: Win32 for i386 Compiling project1.lpr Compiling unit1.pas Compiling resource Z:\Projects\Delphi\Workflow\Revision\RevAdmin\test\lib\i386-win32\project1.or project1.lpr(19,1) Error: Error while compiling resources Linking project1.exe Fatal: Compilation aborted

Can you compare the two directories (temp and saved) and tell where the difference is?

Mattias

Reply by email

patspiper
to Mattias Gaertner
Mattias Gaertner wrote 20 lines
> I save the project to project1.lpi and unit1.pas > > I now run it again. It fails with "project1.lpr(19,1) Error: Error > while compiling resources". > > Hint: Start of reading config file C:\lazarus\fpc\2.6.0\bin\i386-win32\fpc.cfg > Hint: End of reading config file C:\lazarus\fpc\2.6.0\bin\i386-win32\fpc.cfg > Free Pascal Compiler version 2.6.0 [2012/03/14] for i386 > Copyright (c) 1993-2011 by Florian Klaempfl and others > Target OS: Win32 for i386 > Compiling project1.lpr > Compiling unit1.pas > Compiling resource > Z:\Projects\Delphi\Workflow\Revision\RevAdmin\test\lib\i386-win32\project1.or > project1.lpr(19,1) Error: Error while compiling resources > Linking project1.exe > Fatal: Compilation aborted Can you compare the two directories (temp and saved) and tell where the difference is?

Is it possible for the IDE to show the error details? Compiling resource errors always show the generic 'Error: Error while compiling resources' message which is not very indicative.

Stephano

Reply by email

Mattias Gaertner
to patspiper
Show quoted text 24 lines
On 17/04/12 23:57, Mattias Gaertner wrote: > >> I save the project to project1.lpi and unit1.pas >> >> I now run it again. It fails with "project1.lpr(19,1) Error: Error >> while compiling resources". >> >> Hint: Start of reading config file C:\lazarus\fpc\2.6.0\bin\i386-win32\fpc.cfg >> Hint: End of reading config file C:\lazarus\fpc\2.6.0\bin\i386-win32\fpc.cfg >> Free Pascal Compiler version 2.6.0 [2012/03/14] for i386 >> Copyright (c) 1993-2011 by Florian Klaempfl and others >> Target OS: Win32 for i386 >> Compiling project1.lpr >> Compiling unit1.pas >> Compiling resource >> Z:\Projects\Delphi\Workflow\Revision\RevAdmin\test\lib\i386-win32\project1.or >> project1.lpr(19,1) Error: Error while compiling resources >> Linking project1.exe >> Fatal: Compilation aborted > Can you compare the two directories (temp and saved) and tell where the > difference is? Is it possible for the IDE to show the error details? Compiling resource errors always show the generic 'Error: Error while compiling resources' message which is not very indicative.

It now shows the 'Compiling resource <file>' line.

Mattias

Reply by email

Dave Coventry
to Mattias Gaertner: On Tue, 17 Apr 2012 22:51:48 +0200 It is saved to your temp directory and compiled there.…
Mattias Gaertner wrote
It is saved to your temp directory and compiled there.

Yes, of course.

Can you compare the two directories (temp and saved) and tell where the difference is?

Lazarus is running on a Virtualbox Virtual Windows XP guest on an Ubuntu derivative host.

The temp folder is on the Windows virtual Hard Drive, but the Project files are on the Shared Directories on the Linux system where they are accessible to my Linux Lazarus.

Copying the files into the My Documents Folder of the XP user sorted out the problem and the test project now compiles.

Thanks all!

Reply by email

patspiper
to Mattias Gaertner: On Wed, 18 Apr 2012 00:07:31 +0300 It now shows the 'Compiling resource <file>' line.…
Mattias Gaertner wrote 27 lines
On Wed, 18 Apr 2012 00:07:31 +0300 patspiper wrote: > On 17/04/12 23:57, Mattias Gaertner wrote: >>> I save the project to project1.lpi and unit1.pas >>> >>> I now run it again. It fails with "project1.lpr(19,1) Error: Error >>> while compiling resources". >>> >>> Hint: Start of reading config file C:\lazarus\fpc\2.6.0\bin\i386-win32\fpc.cfg >>> Hint: End of reading config file C:\lazarus\fpc\2.6.0\bin\i386-win32\fpc.cfg >>> Free Pascal Compiler version 2.6.0 [2012/03/14] for i386 >>> Copyright (c) 1993-2011 by Florian Klaempfl and others >>> Target OS: Win32 for i386 >>> Compiling project1.lpr >>> Compiling unit1.pas >>> Compiling resource >>> Z:\Projects\Delphi\Workflow\Revision\RevAdmin\test\lib\i386-win32\project1.or >>> project1.lpr(19,1) Error: Error while compiling resources >>> Linking project1.exe >>> Fatal: Compilation aborted >> Can you compare the two directories (temp and saved) and tell where the >> difference is? > Is it possible for the IDE to show the error details? Compiling resource > errors always show the generic 'Error: Error while compiling resources' > message which is not very indicative. It now shows the 'Compiling resource<file>' line.

I was referring more to messages that show the reason of the failure such as fpcres not found, duplicate resource xxxx, etc...

On the other hand, the error line seems to always point to the last line of the lpr file, even when the error is in another file/unit (example: unit with {$R *.lfm} twice).

Stephano

Reply by email

Sven Barth
to patspiper
patspiper wrote 37 lines
On 18/04/12 01:11, Mattias Gaertner wrote: > On Wed, 18 Apr 2012 00:07:31 +0300 > patspiper wrote: > >> On 17/04/12 23:57, Mattias Gaertner wrote: >>>> I save the project to project1.lpi and unit1.pas >>>> >>>> I now run it again. It fails with "project1.lpr(19,1) Error: Error >>>> while compiling resources". >>>> >>>> Hint: Start of reading config file >>>> C:\lazarus\fpc\2.6.0\bin\i386-win32\fpc.cfg >>>> Hint: End of reading config file >>>> C:\lazarus\fpc\2.6.0\bin\i386-win32\fpc.cfg >>>> Free Pascal Compiler version 2.6.0 [2012/03/14] for i386 >>>> Copyright (c) 1993-2011 by Florian Klaempfl and others >>>> Target OS: Win32 for i386 >>>> Compiling project1.lpr >>>> Compiling unit1.pas >>>> Compiling resource >>>> Z:\Projects\Delphi\Workflow\Revision\RevAdmin\test\lib\i386-win32\project1.or >>>> >>>> project1.lpr(19,1) Error: Error while compiling resources >>>> Linking project1.exe >>>> Fatal: Compilation aborted >>> Can you compare the two directories (temp and saved) and tell where the >>> difference is? >> Is it possible for the IDE to show the error details? Compiling resource >> errors always show the generic 'Error: Error while compiling resources' >> message which is not very indicative. > It now shows the 'Compiling resource<file>' line. I was referring more to messages that show the reason of the failure such as fpcres not found, duplicate resource xxxx, etc... On the other hand, the error line seems to always point to the last line of the lpr file, even when the error is in another file/unit (example: unit with {$R *.lfm} twice).

AFAIK this error line is printed by the compiler which does not print more specific errors.

Regards,
Sven

Reply by email