Open ngugcx opened 3 years ago
It's getting that DLL from the system, it's not bundled with the executable. Is there a specific problem you're trying to solve here?
@raphlinus , I built my app(based on druid) on Windows 10 with "-C target-feature=+crt-static". It failed to run on Windows 7 because of missing d2d1.dll and api-ms-win-core-libraryloader-l1-2-0.dll. I have no idea why it needs api-ms-win-core-libraryloader-l1-2-0.dll. I can't find it even on my Windows 10 system, there is only api-ms-win-core-libraryloader-l1-1-0.dll, that's weird.
I wonder if linking d2d1 statically will solve the problem.
I don't understand all subtleties in linking and packaging. To be honest, when testing on Windows 7 I always build on Windows 7, but I definitely see the value in being able to distribute a binary that can run across multiple versions.
From what I do understand, it seems unlikely that statically linking would solve the problem. I can't imagine that a version of d2d1 for Windows 10 would work on Windows 7, and can imagine other problems.
I made a mistake, there IS a d2d1.dll shipped with Windows 7 system. My app fails with:
C:\tests>.\flex.exe
[2mApr 26 11:55:17.566[0m [32m INFO[0m druid_shell::platform::windows::util:
No shcore.dll
[2mApr 26 11:55:17.566[0m [32m INFO[0m druid_shell::platform::windows::util:
Could not load `GetDpiForSystem`. Windows 10 or later is needed
[2mApr 26 11:55:17.566[0m [32m INFO[0m druid_shell::platform::windows::util:
Could not load `GetDpiForWindow`. Windows 10 or later is needed
[2mApr 26 11:55:17.566[0m [32m INFO[0m druid_shell::platform::windows::util:
Could not load `SetProcessDpiAwarenessContext`. Windows 10 or later is needed
[2mApr 26 11:55:17.566[0m [32m INFO[0m druid_shell::platform::windows::util:
Could not load `GetSystemMetricsForDpi`. Windows 10 or later is needed
[2mApr 26 11:55:17.566[0m [32m INFO[0m druid_shell::platform::windows::util:
No dcomp.dll
[2mApr 26 11:55:17.582[0m [34mDEBUG[0m druid::localization: available locale
s [], current en-US
[2mApr 26 11:55:17.582[0m [34mDEBUG[0m druid::localization: resolved: [en-US
]
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: hresult
80004002', druid-shell\src\platform\windows\window.rs:1303:48
I may need to open an issue for druid.
Hmm, odd for that function to be failing (it's D2D1CreateFactory - here's where it's being called). Does this crash if compiled on the Windows 7 machine, or only when compiled on Windows 10 and the executable is run on Windows 7.
The error code is E_NOINTERFACE, which is odd. One thing to try is removing the D2D1_DEBUG_LEVEL_INFORMATION
, as suggested in this StackOverflow question.
My Windows 7 box doesn't have a good network, I can't setup the rust build tools there. Where is D2D1_DEBUG_LEVEL_INFORMATION set? I can't find it in the code.
Does your Windows 7 box have the platform update applied? https://www.microsoft.com/en-ca/download/details.aspx?id=36805
@jrmuizel , the update fixes the problem. Is it possible to get rid of this dependence?
No, we've chosen platform update as the minimum compatibility level for piet and druid. Being compatible with earlier versions would require significant compromise, which we do not think is worth it given that it is pretty far out of date.
I think this issue can be closed?
This should be documented.
I want to build a single file app with druid on Windows. But druid depends on direct2d, d2d1.dll is dynamically linked.