Lazarus

Installation => Windows (32/64) => Topic started by: typo on June 04, 2009, 07:05:10 pm

Title: Error Can't create resource file
Post by: typo on June 04, 2009, 07:05:10 pm
It is my first time on 0.9.26. Win XP.

Thanks.
Title: Re: Error Can't create resource file
Post by: Vincent Snijders on June 04, 2009, 09:29:58 pm
Can you save the project before you compile/run it?
Title: Re: Error Can't create resource file
Post by: typo on June 04, 2009, 09:37:13 pm
Yes, but the message on the compilation is Error: Can't open resource file.
Title: Re: Error Can't create resource file
Post by: Vincent Snijders on June 04, 2009, 09:48:55 pm
In what directory did you save the project?
Title: Re: Error Can't create resource file
Post by: typo on June 04, 2009, 10:41:22 pm
In a folder on the desktop.
Title: Re: Error Can't create resource file
Post by: Vincent Snijders on June 04, 2009, 10:45:40 pm
Depending on your localization and windows version,  that path may contain spaces. What is the full path? Can you save the project in a path without spaces?
Title: Re: Error Can't create resource file
Post by: typo on June 04, 2009, 11:49:44 pm
Yes. Done. Thanks.
Title: Re: Error Can't create resource file
Post by: typo on June 06, 2009, 01:11:09 pm
unitprincipal.pas(362,1) Error: Can't create resource file: C:\lazfilesplitter\lazfilesplitter\source\source\WINRES.RES

Without spaces. Any suggestions?

Thanks.
Title: Re: Error Can't create resource file
Post by: Vincent Snijders on June 06, 2009, 01:18:51 pm
I don't have any suggestions, except to disable manifest and version info.
Title: Re: Error Can't create resource file
Post by: Zaher on June 06, 2009, 07:00:55 pm
May be check the PATH for external tools make problem.
Title: Re: Error Can't create resource file
Post by: typo on June 08, 2009, 09:41:10 pm
Solved. The exe name had spaces.
Title: Re: Error Can't create resource file
Post by: Vincent Snijders on June 08, 2009, 09:46:51 pm
Typo, can you create a bug report for the problem with the exe name with spaces? That way it won't be forgetten and it will be fixed in the future.
Title: Re: Error Can't create resource file
Post by: TDelphiHobbyist on July 26, 2009, 10:47:44 pm
Sorry or the hijack but this is the only thread I can find that is even close to my problem. I'm very very new to Lazarus - still looking at examples to figure out what's going on. I can't get a sample project, containing a res file to compile at all. I do have quite a bit of Delphi experience.

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

The reason I'm posting here is that it looks like it is possible but I just can't figure it out and expect it is some setting I have yet to find.

I've been searching the internet all morning for a solution and decided to try here. Nothing else has worked. I'm a bit frustrated that examples that don't compile are shipped - but then, as I've indicated, it's probably some setting I have yet to find.

Thanks,
Dave
Title: Re: Error Can't create resource file
Post by: Marc on July 30, 2009, 12:14:15 pm
I had the same issue a while ago, but unfortunately I cannot remember how it was solved.
What OS are you using? 32 or 64 bit ?
Title: Re: Error Can't create resource file
Post by: TDelphiHobbyist on July 30, 2009, 06:46:44 pm
What OS are you using? 32 or 64 bit ?
Sorry, I should have mentioned that ... I'm using Win32 [WinXP]

Thanks for responding.
Title: Re: Error Can't create resource file
Post by: typo on July 30, 2009, 07:52:36 pm
I tried to prepare an example project, but I can't reproduce de error on it.
Title: Re: Error Can't create resource file
Post by: TDelphiHobbyist 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.
Title: Re: Error Can't create resource file
Post by: openteacher 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
Title: Re: Error Can't create resource file
Post by: Troodon 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)
Title: Re: Error Can't create resource file
Post by: dima on August 19, 2009, 06:05:09 pm
 :-\
I also have the same problem.
Title: Re: Error Can't create resource file
Post by: dima 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.
Title: Re: Error Can't create resource file
Post by: Troodon 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.
Title: Re: Error Can't create resource file
Post by: Hansaplast 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}
Title: Re: Error Can't create resource file
Post by: dcostel2 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.
TinyPortal © 2005-2018