Recent

Author Topic: windres  (Read 2026 times)

carlangas

  • New member
  • *
  • Posts: 46
windres
« on: August 22, 2018, 06:29:24 pm »
I am using fpcupdeluxe version of lazarus to ease cross-platform compilation.

I have noticed that with certain old projects I have it works perfectly, but there are others where lazarus complains about lacking windres, stopping compilation. The message it sends is this:

Error: resource compiler "i386-win32-windres" not found, switching to external mode

As there is little difference in terms of complexity in both projects, I have been searching for a solution without finding much about this program apart from being a resourse compiler.

What I have noticed is that the project that compiled properly lacked a line including the corresponding *.rc file in its project file (*.lpr), like this:

{$IFDEF WINDOWS}{$R proyecto.rc}{$ENDIF} 

(this line was in the project that did not compile)

So, I have tried removing that line, and everything seems to work.

Must I expect some kind of trouble due to this workaround or is it perfectly right as a way of fixing my issue?

I still don't know what windres is supposed to do if I can safely remove the line that requires it.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 5163
    • wiki
Re: windres
« Reply #1 on: August 22, 2018, 07:00:12 pm »
Afaik (not sure)....

The .rc file  contains how to create the .res file.

So if you remove {$R proyecto.rc}, then any changes to the rc file will no longer get into the res, and the res is what ends up in your application.

carlangas

  • New member
  • *
  • Posts: 46
Re: windres
« Reply #2 on: August 22, 2018, 09:56:40 pm »
The .rc file contains only this line:

MAINICON ICON "proyecto.ico"

If that is the icon it shows on the upper left corner, on the title bar, it works anyway.

I have not tried the resulting .exe in a windows box yet, only under wine, so I don't know whether it will behave the same of if that line is for the application icon shown on the desktop.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 5163
    • wiki
Re: windres
« Reply #3 on: August 22, 2018, 11:57:10 pm »
You probably have the res file already. It will work as long as you do not change the rc file.
Well to be exact, as long as your app does not expect any changes in the res...