Recent

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

440bx

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

heejit

  • Full Member
  • ***
  • Posts: 245
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: 2514
    • 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: 6090
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.

The only true wisdom is knowing you know nothing

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2020
  • Former Delphi 1-7, 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.

heejit

  • Full Member
  • ***
  • Posts: 245
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

  • Administrator
  • Hero Member
  • *
  • Posts: 11382
  • FPC developer.
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: 5446
  • 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

  • Administrator
  • Hero Member
  • *
  • Posts: 11382
  • FPC developer.
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: 5446
  • 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.

 

TinyPortal © 2005-2018