Crates.io | windows-targets |
lib.rs | windows-targets |
version | |
source | src |
created_at | 2022-09-09 14:29:19.927693+00 |
updated_at | 2025-01-07 15:43:41.583963+00 |
description | Import libs for Windows |
homepage | |
repository | https://github.com/microsoft/windows-rs |
max_upload_size | |
id | 661906 |
Cargo.toml error: | TOML parse error at line 19, column 1 | 19 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
The windows-targets crate includes import libs, supports semantic versioning, and optional support for raw-dylib.
Start by adding the following to your Cargo.toml file:
[dependencies.windows-targets]
version = "0.53"
Use the link
macro to define the external functions you wish to call:
windows_targets::link!("kernel32.dll" "system" fn SetLastError(code: u32));
windows_targets::link!("kernel32.dll" "system" fn GetLastError() -> u32);
unsafe {
SetLastError(1234);
assert_eq!(GetLastError(), 1234);
}