Darkmode in Windows 7

I have a crash in some computers when my app is built using Xojo 2021r3.1. The crash only happens when the OS is Windows 7 or Linux 32bit. The message is:

Failture condition: funcAddress Function ‘DesktopApplication_SetUserDarkModeSupport’ was not exported

Has anybody experienced the same issue? and is there a way to fix it?

Does it work if you turn off dark mode support in the build settings?

It is already turned off.