Recent

Author Topic: Error while compiling resources: resource file name becemes project1.or ???  (Read 14559 times)

FangQ

  • Full Member
  • ***
  • Posts: 135
I installed the daily build and sadly found that it was not able to compile the default project.

the console error message is:

Code: [Select]
Compiling /tmp/project1.lpr
Compiling unit1.pas
Compiling resource lib/x86_64-linux/project1.or
project1.lpr(19,1) Error: Error while compiling resources
project1.lpr(19,1) Fatal: There were 1 errors compiling module, stopping

note that the resource file name is strangely becoming project1.or

I found a similar bug filed last year, but it was now closed:

http://bugs.freepascal.org/view.php?id=15613

anyone know what is happening?

Troodon

  • Sr. Member
  • ****
  • Posts: 484
Make sure in the .lpr you do't have both the .rc and the .res lines.
Lazarus/FPC on Linux

FangQ

  • Full Member
  • ***
  • Posts: 135
Make sure in the .lpr you do't have both the .rc and the .res lines.

no, it doesn't. the file list is
Code: [Select]
link.res
backup
lib
project1.ico
project1.lpr
project1.res
unit1.lfm
unit1.pas

under the /tmp directory, and the lpr file reads
Code: [Select]
program Project1;

{$mode objfpc}{$H+}

uses
  {$IFDEF UNIX}{$IFDEF UseCThreads}
  cthreads,
  {$ENDIF}{$ENDIF}
  Interfaces, // this includes the LCL widgetset
  Forms, Unit1
  { you can add units after this };

{$R *.res}

begin
  Application.Initialize;
  Application.CreateForm(TForm1, Form1);
  Application.Run;
end.

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4694
  • I like bugs.
Spaces in the project path name?
You could also check the Project Options -> Miscellaneous -> Resource type.
Is it ".lrs include files" or "FPC resources"?

Juha
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

FangQ

  • Full Member
  • ***
  • Posts: 135
Spaces in the project path name?
You could also check the Project Options -> Miscellaneous -> Resource type.
Is it ".lrs include files" or "FPC resources"?

Juha


hi Juha

there is no space in the file name, the full path is /tmp/project1.lpr

the resource type was "FPC resources", but if I choose "lrs include files", I got the same error.

I am so surprised that other people do not have this issue. Maybe I am the only one using the daily build? (I did try 0.9.28-2, it failed to compile glscene for some reasons)

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4694
  • I like bugs.
Bug reports mentioned a bug in FPC related to spaces and other special chars in path. It is fixed in trunk some time ago. You don't have spaces so it should not affect.
I don't have other ideas so you could try the latest FPC SVN version, too.

Juha
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

FangQ

  • Full Member
  • ***
  • Posts: 135
Bug reports mentioned a bug in FPC related to spaces and other special chars in path. It is fixed in trunk some time ago. You don't have spaces so it should not affect.
I don't have other ideas so you could try the latest FPC SVN version, too.

Juha


I finally gave up using the daily build of lazarus, and went back to 0.9.28.2, it does not have this issue (well, then I have to fix the glScene issue :( )

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4694
  • I like bugs.
I finally gave up using the daily build of lazarus, and went back to 0.9.28.2, it does not have this issue (well, then I have to fix the glScene issue :( )
Did you also try with latest FPC version from SVN server?
The problem is likely in FPC, not in Lazarus.

Juha
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

99Percent

  • Full Member
  • ***
  • Posts: 160
I also got this message in my project, but I was able to fix it by commenting out the following line in my lpr file:

Code: [Select]
{$IFDEF WINDOWS}{$R cajasuc3.rc}{$ENDIF}
This just happened with the latest daily Lazarus snapshot.

It would be good if the message was a bit more informative. Should it be reported in the bug tracker? If so which one, the Lazarus or FPC?

 

TinyPortal © 2005-2018