Recent

Author Topic: [SOLVED] Compiled Win32 Exe not running on Window XP (CRC Check Failed)  (Read 2121 times)

440bx

  • Hero Member
  • *****
  • Posts: 1289
I meant "image" as in graphics image, not binary executable image.   :P
In this particular case the term "image" is rather ambiguous <chuckle>
using FPC v3.0.4 and Lazarus 1.8.2 on Windows 7 64bit.

jshah

  • Full Member
  • ***
  • Posts: 200
Re: [SOLVED] Compiled Win32 Exe not running on Window XP (CRC Check Failed)
« Reply #31 on: December 02, 2019, 10:40:00 pm »
Even same application cross-compile to RaspberryPI also working without any error so this must be issue related to the OS

avra

  • Hero Member
  • *****
  • Posts: 1737
    • Additional info
Re: [SOLVED] Compiled Win32 Exe not running on Window XP (CRC Check Failed)
« Reply #32 on: December 03, 2019, 01:16:51 am »
What happens if you use these compiler switches:
Code: Pascal  [Select]
  1. -O2 -g- -Xs -CpPENTIUM4 -CfSSE3
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

jamie

  • Hero Member
  • *****
  • Posts: 2168
Re: [SOLVED] Compiled Win32 Exe not running on Window XP (CRC Check Failed)
« Reply #33 on: December 03, 2019, 02:43:23 am »
I have had issues moving Projects created on newer OSes over to older one's via USB flash stick and have the OS refuse to load the file, claims to have CRC errors.

 But the same file will work on the newer OS, even from the USB stick .. That tells me the file format may have an issue.

 I did this with W2k one, an OLD file that should work on W2k would not execute when taking from a flash storage done by a newer OS.

Number 1 at blue screen app creations!

trev

  • Sr. Member
  • ****
  • Posts: 258
  • Former Delphi 7 and Delphi 10.2 User
Re: [SOLVED] Compiled Win32 Exe not running on Window XP (CRC Check Failed)
« Reply #34 on: December 03, 2019, 04:45:44 am »
In my experience this usually occurs because the CPU in the newer operating system supports more instructions than the CPU in the older operating system. So not operating system dependent so much as CPU dependent.
o Lazarus v2.1.0 r61775, FPC v3.3.1 r42640, macOS 10.14.6 (with sup update), Xcode 10.3
o Lazarus v2.1.0 r61574, FPC v3.3.1 r42318, FreeBSD 12.0 (Parallels VM)
o Lazarus v2.1.0 r61574, FPC v3.0.4, Ubuntu 18.04 (Parallels VM)

jshah

  • Full Member
  • ***
  • Posts: 200
Re: [SOLVED] Compiled Win32 Exe not running on Window XP (CRC Check Failed)
« Reply #35 on: December 03, 2019, 12:30:04 pm »
Not working same issue
What happens if you use these compiler switches:
Code: Pascal  [Select]
  1. -O2 -g- -Xs -CpPENTIUM4 -CfSSE3

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7630
Re: [SOLVED] Compiled Win32 Exe not running on Window XP (CRC Check Failed)
« Reply #36 on: December 03, 2019, 12:50:18 pm »
Vista and Win8 changed icons a lot. (larger, png instead only bmp). But for the icon, there would be no fcl-image exception, since those icons would be loaded by the explorer.

So the question remains where the image comes from

PascalDragon

  • Hero Member
  • *****
  • Posts: 735
  • Compiler Developer
Re: [SOLVED] Compiled Win32 Exe not running on Window XP (CRC Check Failed)
« Reply #37 on: December 03, 2019, 02:55:49 pm »
To target 32-bit x86 targets use a 32-bit x86 compiler. IOW make sure your installed *nix compiler is 32-bit.
Compiling for i386 is only a problem with x86_64-win64 and any non-x86 target. x86_64-linux for example can compile for i386-win32 without any problems.

Vista and Win8 changed icons a lot. (larger, png instead only bmp). But for the icon, there would be no fcl-image exception, since those icons would be loaded by the explorer.

So the question remains where the image comes from
jshah wrote that removing the application icon solved it. Icon files have multiple sizes defined in them and in Vista and newer aside from bitmap data - as you wrote - can also contain PNG data. The default application icon of Lazarus does contain such data. Maybe the resource mechanism gets confused on XP with the PNG subicon or Lazarus somehow picks the wrong one.

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7630
Re: [SOLVED] Compiled Win32 Exe not running on Window XP (CRC Check Failed)
« Reply #38 on: December 03, 2019, 05:41:49 pm »
To target 32-bit x86 targets use a 32-bit x86 compiler. IOW make sure your installed *nix compiler is 32-bit.
Compiling for i386 is only a problem with x86_64-win64 and any non-x86 target. x86_64-linux for example can compile for i386-win32 without any problems.

Whoops yes. *nix still uses FPU.

Quote
Vista and Win8 changed icons a lot. (larger, png instead only bmp). But for the icon, there would be no fcl-image exception, since those icons would be loaded by the explorer.

So the question remains where the image comes from
jshah wrote that removing the application icon solved it. Icon files have multiple sizes defined in them and in Vista and newer aside from bitmap data - as you wrote - can also contain PNG data. The default application icon of Lazarus does contain such data. Maybe the resource mechanism gets confused on XP with the PNG subicon or Lazarus somehow picks the wrong one.

If true that means actual lzarus code is mediator between resources and windows/explorer for the icons. That is IMHO somewhat doubtfull, since that would mean that the windows explorer would have to launch all exes to get the icon.

Still it could be that somehow Lazarus falsely manifests a "live icon" or so that makes that happen

PascalDragon

  • Hero Member
  • *****
  • Posts: 735
  • Compiler Developer
Re: [SOLVED] Compiled Win32 Exe not running on Window XP (CRC Check Failed)
« Reply #39 on: December 04, 2019, 09:17:34 am »
Quote
Vista and Win8 changed icons a lot. (larger, png instead only bmp). But for the icon, there would be no fcl-image exception, since those icons would be loaded by the explorer.

So the question remains where the image comes from
jshah wrote that removing the application icon solved it. Icon files have multiple sizes defined in them and in Vista and newer aside from bitmap data - as you wrote - can also contain PNG data. The default application icon of Lazarus does contain such data. Maybe the resource mechanism gets confused on XP with the PNG subicon or Lazarus somehow picks the wrong one.

If true that means actual lzarus code is mediator between resources and windows/explorer for the icons. That is IMHO somewhat doubtfull, since that would mean that the windows explorer would have to launch all exes to get the icon.

Still it could be that somehow Lazarus falsely manifests a "live icon" or so that makes that happen
Not the Explorer, but the window/application icon. That is set by Lazarus code.