且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

无法从 WinApi crate 调用 CryptDecrypt,因为它找不到模块

更新时间:2023-11-18 22:34:34

来自 crate 级文档:

每个模块都在功能标志上门控,因此您必须启用适当的功能来访问这些项目.例如,如果你想要使用来自 winapi::um::winuser 的东西,你必须启用winuser 功能.

Frequently asked questions

Why am I getting errors about unresolved imports?

Each module is gated on a feature flag, so you must enable the appropriate feature to gain access to those items. For example, if you want to use something from winapi::um::winuser you must enable the winuser feature.

在这种情况下,您需要添加wincrypt:

In this case, you need to add wincrypt:

[target.'cfg(windows)'.dependencies]
winapi = { version = "0.3", features = ["wincrypt"] }