Recent

Author Topic: Error Can't create resource file  (Read 27876 times)

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: Error Can't create resource file
« Reply #15 on: July 30, 2009, 07:52:36 pm »
I tried to prepare an example project, but I can't reproduce de error on it.

TDelphiHobbyist

  • New Member
  • *
  • Posts: 12
    • TDelphiHobbyist
Re: Error Can't create resource file
« Reply #16 on: July 31, 2009, 01:19:04 am »
I tried to prepare an example project, but I can't reproduce de error on it.
Hi typo

Does:
\Lazarus\examples\trayicon\wndtray.lpi
compile properly for you??

That's the one I'm trying to get working.

openteacher

  • Newbie
  • Posts: 1
Re: Error Can't create resource file
« Reply #17 on: August 19, 2009, 03:45:34 pm »
I have exactly the same problem as described in this thread. It occured, when I tried a Delphi-Project that I had converted to Lazarus.

In my installation (WinXP 32bit; Lazarus 0.9.26.2; FreePascal Compiler 2.2.2) the trayicon example does not work, neither.  

wndtray.dpr(40,1) Error: Can't create resource file: C:\lazarus\examples\trayicon\magnifier.res
wndtray.dpr(40,1) Fatal: There were 1 errors compiling module, stopping

Have I made any mistake in the installation or is this a Lazarus bug.

Thank you very much in advance
- Peter
« Last Edit: August 19, 2009, 03:48:10 pm by openteacher »

Troodon

  • Sr. Member
  • ****
  • Posts: 484
Re: Error Can't create resource file
« Reply #18 on: August 19, 2009, 05:10:56 pm »
I'm using the latest release [0.9.26.2 beta] and trying to compile the example:
E:\Lazarus\examples\trayicon
I keep getting:
wndtray.dpr(42,1) Error: Can't create resource file: E:\Lazarus\examples\trayicon\magnifier.res

Works here (see attached image for release info)
Lazarus/FPC on Linux

dima

  • Newbie
  • Posts: 4
Re: Error Can't create resource file
« Reply #19 on: August 19, 2009, 06:05:09 pm »
 :-\
I also have the same problem.

dima

  • Newbie
  • Posts: 4
Re: Error Can't create resource file
« Reply #20 on: August 19, 2009, 06:25:24 pm »
Troodon

open wndtray.lpr and comment out
{$ifdef Windows}
  //{$R magnifier.res}
{$endif}   


IMHO this is just conditional defines setup.
Does anybody know where in Lazarus conditional defines are setup?

I should mention(it seems) that this problem appeared after i have recompiled IDE.

Troodon

  • Sr. Member
  • ****
  • Posts: 484
Re: Error Can't create resource file
« Reply #21 on: August 19, 2009, 06:35:35 pm »
open wndtray.lpr

Hm, interesting... I dont have a .lpr file in that directory, maybe that's why the projects builds succesfully.

update: ok, so the .lpr is actually a .dpr file and in the .dpr file I don't need to comment out the

Code: [Select]
{$ifdef Windows}
  {$R magnifier.res}
{$endif}

part to succesfully build the project.
« Last Edit: August 19, 2009, 06:42:26 pm by Troodon »
Lazarus/FPC on Linux

Hansaplast

  • Hero Member
  • *****
  • Posts: 539
  • Tweaking4All.com
    • Tweaking4All
Re: Error Can't create resource file
« Reply #22 on: January 29, 2012, 11:07:18 pm »
Great tip - had run into this one before an couldn't remember how I resolved it ...

Simple remove the line below from the lpr file ...

Code: [Select]
{$IFDEF WINDOWS}{$R project1.rc}{$ENDIF}

dcostel2

  • Newbie
  • Posts: 1
Re: Error Can't create resource file
« Reply #23 on: March 11, 2019, 03:43:57 pm »
I had a problem compiling and running my very first program in FPC via Lazarus; the error message is
           Can't open resource file "<path><name>.res"

Setting aside the question of what is a resource file and how does one create it, the source of the error is that the sample code I had started with includes the line
           {$R *.res}
Deleting this solved the problem. When the day comes that I need a resource file, I'll figure out how to create one. For now, at least, I can get back to writing my Pascal code.