Sign in Join

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

Mailing lists / lazarus / 2011-01

Error while compiling resources...

13 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

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

Bo Berglund

I have created a class to handle the communications towards a data acquisition instrument.

Now I am preparing the test application so I have simply made a form with some entry boxes and a button.
Here is the main program file content:

program commtest;
{$mode objfpc}{$H+}

uses

  {$IFDEF UNIX}{$IFDEF UseCThreads}
  cthreads,
  {$ENDIF}{$ENDIF}
  Interfaces, // this includes the LCL widgetset
  Forms, sdposeriallaz, formmain, agisscomm, sscommtypes, sscommbuf
  { you can add units after this };
{$IFDEF WINDOWS}{$R commtest.rc}{$ENDIF}
{$R *.res}
begin
  Application.Initialize;
  Application.CreateForm(TForm1, Form1);
  Application.Run;
end.

When I try to run or build this there is an error on compilation, which did not happen before I added a Spinedit, a Combobox and a Shape to the main form. It is this:

commtest.lpr(21,1) Error: Error while compiling resources
commtest.lpr(21,1) Fatal: There were 1 errors compiling module,
stopping

I have no idea from where this comes or what to do about it. In Delphi the version resources etc were handled by Delphi so there was no need to manually create or edit rc files.
In fact there *is* a commtest.rc file in the project folder probably created by lazarus so what is the problem?

Bo Berglund

Reply by email

Paul Ishenin
to Bo Berglund
Bo Berglund wrote
{$IFDEF WINDOWS}{$R commtest.rc}{$ENDIF}

resource which was added by lazarus 0.9.26

{$R *.res}

added by lazarus 0.9.30?

Remove {$IFDEF WINDOWS}{$R commtest.rc}{$ENDIF} and try again.

Best regards,
Paul Ishenin

Reply by email

Graeme Geldenhuys
to Paul Ishenin

Op 2011-02-01 01:07, Paul Ishenin het geskryf:

Show quoted text 8 lines
01.02.2011 5:28, Bo Berglund wrote: > {$IFDEF WINDOWS}{$R commtest.rc}{$ENDIF} resource which was added by lazarus 0.9.26 > {$R *.res} added by lazarus 0.9.30? Remove {$IFDEF WINDOWS}{$R commtest.rc}{$ENDIF} and try again.

Paul, I haven't tried the original posters sample app, but if your hint is indeed the solution, maybe that hint could be added to the F1 help on compiler errors/hints in Messages window? I have no idea where Lazarus IDE gets/stores those hints, but they are there, and give you a little popup dialog with bigger description of the error. Delphi/Kylix IDE was very good at those hints and gave extensive help - Lazarus IDE is still a bit vague sometimes, but any added hints descriptions will start making it more useful.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/

Reply by email

Paul Ishenin
to Graeme Geldenhuys
Graeme Geldenhuys wrote
Paul, I haven't tried the original posters sample app, but if your hint is indeed the solution, maybe that hint could be added to the F1 help on compiler errors/hints in Messages window?

As I know Lazarus does not have a feature to show a help for compiler error/warnings/hints. And yes, I like this feature in other IDEs like Delphi.

Btw, I wrote a blog post a year ago where I paied an attention to this problem too:
http://lazarus-dev.blogspot.com/2010/02/work-on-0930-changes-in-resource.html

Best regards,
Paul Ishenin

Reply by email

Graeme Geldenhuys
to Paul Ishenin

Op 2011-02-01 08:46, Paul Ishenin het geskryf:

As I know Lazarus does not have a feature to show a help for compiler error/warnings/hints.

Well, my copy of Lazarus 0.9.29 (.30 fixes branch) does indeed show such help. It's small, but it's there. See attached screenshot.

And yes, I like this feature in other IDEs like Delphi.

It's helped me a lot over the years too.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ -------------- next part -------------- A non-text attachment was scrubbed... Name: Untitled.png Type: image/png Size: 11702 bytes Desc: not available URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110201/fb44d382/attachment-0001.png>

Reply by email

Bo Berglund
to Paul Ishenin: resource which was added by lazarus 0.9.26 added by lazarus 0.9.30? Remove {$IFDEF…
Paul Ishenin wrote 8 lines
01.02.2011 5:28, Bo Berglund wrote: > {$IFDEF WINDOWS}{$R commtest.rc}{$ENDIF} resource which was added by lazarus 0.9.26 > {$R *.res} added by lazarus 0.9.30? Remove {$IFDEF WINDOWS}{$R commtest.rc}{$ENDIF} and try again.

I commented out that line and the application compiled fine. :-)

The question is from where it came, this application was started when I used an earlier version of Lazarus and at first I used the form only to test some endian conversion functions I need to use for the data from the attached equipment. Then yesterday I changed it to be the test for my new functionality and at this time I was on lazarus_0_9_30_fixes.
Maybe there is a change in behaviour between _0_9_29_fixes and the new one?

Bo Berglund Developer in Sweden

Reply by email

Paul Ishenin
to Bo Berglund
Bo Berglund wrote 8 lines
The question is from where it came, this application was started when I used an earlier version of Lazarus and at first I used the form only to test some endian conversion functions I need to use for the data from the attached equipment. Then yesterday I changed it to be the test for my new functionality and at this time I was on lazarus_0_9_30_fixes. Maybe there is a change in behaviour between _0_9_29_fixes and the new one?

Please read this article again:
http://lazarus-dev.blogspot.com/2010/02/work-on-0930-changes-in-resource.html

There are two warnings in it. One of them is about problem you see.

Best regards,
Paul Ishenin

Reply by email

Sven Barth
to Graeme Geldenhuys: Op 2011-02-01 08:46, Paul Ishenin het geskryf: Well, my copy of Lazarus 0.9.29 (.30 fixes…
Graeme Geldenhuys wrote 7 lines
Op 2011-02-01 08:46, Paul Ishenin het geskryf: > > As I know Lazarus does not have a feature to show a help for compiler > error/warnings/hints. Well, my copy of Lazarus 0.9.29 (.30 fixes branch) does indeed show such help. It's small, but it's there. See attached screenshot.

The information of the errors might come from the
$fpcsrc/compiler/msg/errore.msg file (I don't know how they are collected by Lazarus though).

Regards,
Sven

Reply by email

Mattias Gaertner
to Sven Barth
Show quoted text 12 lines
Am 01.02.2011 08:47, schrieb Graeme Geldenhuys: > Op 2011-02-01 08:46, Paul Ishenin het geskryf: >> >> As I know Lazarus does not have a feature to show a help for compiler >> error/warnings/hints. > > Well, my copy of Lazarus 0.9.29 (.30 fixes branch) does indeed show such > help. It's small, but it's there. See attached screenshot. The information of the errors might come from the $fpcsrc/compiler/msg/errore.msg file (I don't know how they are collected by Lazarus though).

This might help:
http://wiki.lazarus.freepascal.org/Creating_IDE_Help#Help_for_Messages

Mattias

Reply by email

Graeme Geldenhuys
to Mattias Gaertner

Op 2011-02-01 11:17, Mattias Gaertner het geskryf:

Is there a way to hook into external (non-wiki) help systems too? eg: Say I have created detailed Compiler Messages Help in INF help format? Thus by pressing F1 on a compiler message, I would rather want to display the INF help.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/

Reply by email

Mattias Gaertner
to Graeme Geldenhuys
Show quoted text 10 lines
Op 2011-02-01 11:17, Mattias Gaertner het geskryf: > > This might help: > http://wiki.lazarus.freepascal.org/Creating_IDE_Help#Help_for_Messages Is there a way to hook into external (non-wiki) help systems too? eg: Say I have created detailed Compiler Messages Help in INF help format? Thus by pressing F1 on a compiler message, I would rather want to display the INF help.

I moved the FPCMessagesHelpDB to the ideintf unit idehelpintf. You can alter it or replace it.

Mattias

Reply by email

Bo Berglund
to Paul Ishenin: Please read this article again: http://lazarus-dev.blogspot.com/2010/02/work-on-0930-chang…
Paul Ishenin wrote 9 lines
> lazarus_0_9_30_fixes. > Maybe there is a change in behaviour between _0_9_29_fixes and the new > one? Please read this article again: http://lazarus-dev.blogspot.com/2010/02/work-on-0930-changes-in-resource.html There are two warnings in it. One of them is about problem you see.

Well, I just wanted to report back tha your original suggestion about getting rid of the extar resource directive worked. Since it did I did not read the article that you posted in the next message.

Notice: I am reading these messages in a news reader via the news mirror at GMane and this makes me follow threads rather than time lines....

Anyway thanks for your pointers! Now I can go on debugging the serial communications instead. :-)

Bo Berglund Developer in Sweden

Reply by email