Recent

Author Topic: Reusing/cross-compiling 32 bit resources  (Read 1705 times)

TyneBridges

  • Full Member
  • ***
  • Posts: 150
    • Personal blog
Reusing/cross-compiling 32 bit resources
« on: June 14, 2020, 03:15:26 pm »
I'm trying to update and compile a project that I was developing on Windows 7 (32 bit, I think) some years ago. This is being developed on, and is only intended to run on, Windows 10 64 bit.

Code: Text  [Select][+][-]
  1. Compile Project, Target: lclient.exe: Exit code 1, Errors: 1, Warnings: 2
  2. Warning: windres [option(s)] [input-file] [output-file]
  3. Warning: windres: supported targets: pe-i386 pei-i386 elf32-i386 elf32-little elf32-big srec symbolsrec verilog tekhex binary ihex
  4. lclient.lpr(26,1) Error: Error while compiling resources -> Compile with -vd for more details. Check for duplicates.

I've looked in this forum and elsewhere for clues as to how to fix this but can't see any advice that I'm able to understand or follow. Looking back to advice I got here years ago (which helped me fix the problem on Windows 7) I see a reference to GoRC.exe, which no longer seems to exist.

My resource file icons.rc lists the following, which are all present.

Code: Text  [Select][+][-]
  1. i1 ICON "i1.ico"
  2. i2 ICON "i2.ico"
  3. i3 ICON "i3.ico"
  4. i4 ICON "i4.ico"
  5. i5 ICON "i5.ico"

I've updated a console application from the same date and this will compile without errors. Is the error to do with cross-compilation of resources? Any advice on how to fix it would be appreciated.

Version 2.0.8
Date: 2020-04-11
FPC Version 3.0.4
SVN Revision 62944
x86_64-win64-win32/win64

Edit: I've just spotted the info online about LRS Explorer. I've installed that and added an lrs file with my icons in it, but still get exactly the same errors when I try compiling.

Thanks.
« Last Edit: June 14, 2020, 03:26:47 pm by TyneBridges »
John H, north east England
Lover of the old Delphi, still inexperienced with FPC/Lazarus and not an instinctive programmer

PascalDragon

  • Hero Member
  • *****
  • Posts: 5486
  • Compiler Developer
Re: Reusing/cross-compiling 32 bit resources
« Reply #1 on: June 14, 2020, 04:42:25 pm »
I've looked in this forum and elsewhere for clues as to how to fix this but can't see any advice that I'm able to understand or follow. Looking back to advice I got here years ago (which helped me fix the problem on Windows 7) I see a reference to GoRC.exe, which no longer seems to exist.[/url]

You can find GoRC here. I really wonder why Lazarus distributes Windres for Win64 instead of GoRC...

Edit: I've just spotted the info online about LRS Explorer. I've installed that and added an lrs file with my icons in it, but still get exactly the same errors when I try compiling.

LRS resources are the old style resources, not the Windows PE/COFF based ones.

TyneBridges

  • Full Member
  • ***
  • Posts: 150
    • Personal blog
Re: Reusing/cross-compiling 32 bit resources
« Reply #2 on: June 14, 2020, 05:17:06 pm »
LRS resources are the old style resources, not the Windows PE/COFF based ones.

Thanks for your response but I don't understand what it means. How can I add my icon resources so that Lazarus will accept them?
John H, north east England
Lover of the old Delphi, still inexperienced with FPC/Lazarus and not an instinctive programmer

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Reusing/cross-compiling 32 bit resources
« Reply #3 on: June 14, 2020, 05:40:06 pm »
How can I add my icon resources so that Lazarus will accept them?

The simplest way is, probably, by going to "Project->Project Options", selecting "Resources" and adding them there.
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

TyneBridges

  • Full Member
  • ***
  • Posts: 150
    • Personal blog
Re: Reusing/cross-compiling 32 bit resources
« Reply #4 on: June 14, 2020, 07:53:14 pm »

The simplest way is, probably, by going to "Project->Project Options", selecting "Resources" and adding them there.

Thanks. Adding them there seemed to work once I'd removed them from the compiler directives in the code - at least the application will now compile. The icon does not show in the system tray as it did in Windows 7 so there may be other revisions needed to my code.
John H, north east England
Lover of the old Delphi, still inexperienced with FPC/Lazarus and not an instinctive programmer

 

TinyPortal © 2005-2018