Recent

Author Topic: Error while compiling resources  (Read 9004 times)

hy

  • Full Member
  • ***
  • Posts: 221
Error while compiling resources
« on: September 05, 2014, 04:45:22 pm »
Hi,
it's a long time since I used lazarus.
Yesterday I installed fpc on debian and pulled lazarus from svn.
Today I tried to convert a Delphi-project.
The units and libraries went more or less fine (because I had ported the project to lazarus alreade a few years ago), but finally the compiler stopped at the end of my lpr-file:

yMap.lpr(114,1) Error: Error while compiling resources -> Compile with -vd for more details. Check for duplicates.

Can't get rid of the error message.
if I use -vd I get:
Code: [Select]
Unable to find file "Debug: Readin/media/work/src.hg/ylazyMap/yMap.lpr".
If it belongs to your project, check search path in
Project -> Compiler Options -> Search Paths -> Other Unit Files. If this file belongs to a package, check the appropriate package compiler options. If this file belongs to Lazarus, make sure compiling clean. If the file belongs to FPC then check fpc.cfg. If unsure, check Project -> CompilerOptions -> Test

lpr-code
Code: [Select]
program yMap;

uses
   {$IFDEF UNIX}{$IFDEF UseCThreads}
cthreads,
   {$ENDIF}{$ENDIF}
Interfaces, // this includes the LCL widgetset
Forms,
graphics,
sysUtils,
types,
LCLIntf, LCLType, LMessages, //keybd_event
ym_main in 'ym_main.pas' {frm_gm_main};
   






var frm_yMap_main : Tfrm_yMap_Main;
   {$R *.res}
begin
Application.Initialize;

Application.Title := 'yMap';
{$ifdef German}
Application.HelpFile := ExtractFilePath(application.ExeName)+'YMAPD.HLP';

{$else}
//Application.HelpFile := ExtractFilePath(application.ExeName)+'YMAPE.HLP';
{$endif}
Application.CreateForm(Tfrm_yMap_main, frm_yMap_main);
  if frm_yMap_main.wCLMode = $FFFF then
        begin
        frm_yMap_main.Free;
            //Keybd_EVENT(VK_RETURN,0,0,0);
                //Freeconsole;
        end
        else
        Application.Run; //Action

end.

I have created an empty project and copied the resource-file to my project but to no avail.
Any help apreciated
« Last Edit: September 06, 2014, 11:42:02 pm by hy »
_____
***hy
OS: debian sid(64bit)  [fpc 3.20] Lazarus 2.0.12

engkin

  • Hero Member
  • *****
  • Posts: 3112
Re: Error while compiling resources
« Reply #1 on: September 05, 2014, 07:39:59 pm »
yMap.lpr(114,1) Error: Error while compiling resources -> Compile with -vd for more details. Check for duplicates.
Your lpr-code is less than 50 lines, while the error message mentions line 114. Can you explain that?

Edit:
Ah.. resource. Can you upload your resource file?
« Last Edit: September 05, 2014, 07:43:39 pm by engkin »

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: Error while compiling resources
« Reply #2 on: September 05, 2014, 07:45:50 pm »
Perhaps your subdirectory /src.hg/ containing a dot is causing problems?

hy

  • Full Member
  • ***
  • Posts: 221
Re: Error while compiling resources
« Reply #3 on: September 06, 2014, 10:28:21 am »
engkin: I removed comments in the header.
I'll put it in another directory and try again
[edit:]Another directory didn't change anything
Resource-fileload from filehorst
« Last Edit: September 06, 2014, 10:50:17 am by hy »
_____
***hy
OS: debian sid(64bit)  [fpc 3.20] Lazarus 2.0.12

engkin

  • Hero Member
  • *****
  • Posts: 3112
Re: Error while compiling resources
« Reply #4 on: September 06, 2014, 05:39:12 pm »
1-Close Lazarus
2-Delete the resource file
3-Start Lazarus
4-Open your project
5-Compile it
Do you get the same problem?

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4459
  • I like bugs.
Re: Error while compiling resources
« Reply #5 on: September 06, 2014, 06:48:36 pm »
Did you use the converter from Tools menu or did you convert manually?
Case sensitive file names cause problems when moving from Windows to Linux.
For example if you have file "YMAP.RES" then this:
 {$R *.res}
works on Windows but not on Linux.
The converter mostly takes care of the issue although there are still bugs.
 http://bugs.freepascal.org/view.php?id=25354
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

hy

  • Full Member
  • ***
  • Posts: 221
Re: Error while compiling resources
« Reply #6 on: September 06, 2014, 11:41:35 pm »
Hi thanks for trying to help me.
Case sensitivity is not an issue I am aware of that.

But after some research I found that some ressources of used libraries are not working either.
If I create a new project with an empty form it works.
If I add a unit from my library (which has another form) the compiler complains about the resources of the form.

So after all I started to convert all forms one by one.
Which is a drag.
I will not overstress this topic in complainig about the conversion routines. (The source is 100% Lazarus compatible - but the forms are NOT.) I think the compiler should not display the last source line of the project file and state

 Error while compiling resources -> Compile with -vd for more details. Check for duplicates.

It should name the resource/unit in question.
_____
***hy
OS: debian sid(64bit)  [fpc 3.20] Lazarus 2.0.12

krzynio

  • Jr. Member
  • **
  • Posts: 99
    • Krzynio's home page
Re: Error while compiling resources
« Reply #7 on: November 14, 2018, 11:47:53 pm »
I had the same problem several times including today.
I am working with Lazarus on virtual machine with dynamic hard drive.
When the space on hard drive ends during compilation or editing a form then lfm file may be damaged, usually truncated.
Usually this is the last editing form.
My solution is to restore lfm file from backup or restore only damaged part of the file using backup file and text editor.
Ubuntu 23.10 x64, / Windows 11 PL - latest updates
Lazarus 2.2.6, FPC 3.2.2

Blaazen

  • Hero Member
  • *****
  • Posts: 3237
  • POKE 54296,15
    • Eye-Candy Controls
909
« Reply #8 on: November 15, 2018, 02:20:50 am »
I had it too a few days ago. I tried to reload directories in lazarus root one by one to find the bug. I am ~90% sure it was in dir components, probably related to Online Package Manager. Finally, I did fresh
Code: [Select]
$ svn co https://svn.freepascal.org/svn/lazarus/trunk lazarusand it is OK now.
Lazarus 2.3.0 (rev main-2_3-2863...) FPC 3.3.1 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

 

TinyPortal © 2005-2018