-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
C-bugCategory: This is a bug.Category: This is a bug.F-raw_dylib`#![feature(raw_dylib)]``#![feature(raw_dylib)]`O-windows-gnuToolchain: GNU, Operating system: WindowsToolchain: GNU, Operating system: WindowsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
I tried this code:
#![feature(raw_dylib)]
fn main() {
unsafe {
MessageBoxA(0, b"hello\0".as_ptr(), "world\0".as_ptr(), 0);
}
}
#[link(name = "user32", kind = "raw-dylib")]
extern "system" {
fn MessageBoxA(hwnd: usize, lptext: *const u8, lpcaption: *const u8, flags: u32) -> i32;
}
I expected to see this happen:
Successful compilation
Instead, this happened:
$ PATH=/d/msys64/mingw32/bin:$PATH /c/Users/mateusz/.cargo/bin/rustc test.rs --target i686-pc-windows-gnu
error: Error calling dlltool: program not found
error: aborting due to previous error
Worth mentioning it works fine when building natively from x86_64 to x86_64 target.
Meta
rustc --version --verbose
:
rustc 1.67.0-nightly (edf018221 2022-11-02)
binary: rustc
commit-hash: edf0182213a9e30982eb34f3925ddc4cf5ed3471
commit-date: 2022-11-02
host: x86_64-pc-windows-gnu
release: 1.67.0-nightly
LLVM version: 15.0.4
jhassekands-code
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.F-raw_dylib`#![feature(raw_dylib)]``#![feature(raw_dylib)]`O-windows-gnuToolchain: GNU, Operating system: WindowsToolchain: GNU, Operating system: WindowsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.