1

We build a windows desktop application using flutter desktop and want to distribute it. But after distributing exe file, we got error

The procedure entry point GetSystemMetricsForDpi could not be located in the dynamic link library USER32.dll

This error only show in windows 7 and application works properly on windows 10. Please help us to solve this issue. Thank you

1 Answers1

2

That function is only available in Windows 10, so there's no way to make your application run on Windows 7 as-is. However, than function isn't used in a stock Flutter application, so either:

  • you added it to your Runner code, in which case the solution is not to do that, and to do whatever you are trying to do in a Windows 7-compatible way, or
  • you are using a plugin that calls it, in which case you need to either:
    • stop using that plugin, or
    • ask the plugin's developer to support Windows 7.
smorgan
  • 20,228
  • 3
  • 47
  • 55
  • I am just trying to add for function in core desktop project code but unable to do that. It their any hack to do that? – Suraj Aggarwal Jun 15 '21 at 13:06
  • A hack to do what? If you unconditionally link functions from the Windows 10 SDK your app will need Windows 10 to run. That's how the Windows SDK works. I suggest posting a new question where you explain what *functionality* you want to implement using Win32 in a Windows 7-compatible way, rather than asking how to use a Windows 10 API on Windows 7. – smorgan Jun 15 '21 at 23:37