-
-
Notifications
You must be signed in to change notification settings - Fork 391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Link directly against DLLs for gnu
toolchains to eliminate the need for import libraries
#478
Comments
gnu
toolchains to eliminate the need for import libraries
No. Providing import libraries is something that I can do and ensures linking will always work regardless of what the host system is. |
As far as I can understand, the
winapi-i386/x86_64-pc-windows-gnu
crates exist because the Rust MinGW toolchain does not include the import libraries for these DLLs, right? Therefore there should no way to link against them.Except there is, and it requires no import libraries.
ld
is a really cool linker - it's able to link against DLLs without requiring an import.lib
file.Here is an example. Let's say I am trying to build this using the
nightly-gnu
toolchain on Windows:If I compile this as-is, I get a link error with the
ld
linker.But
AudioEng
is a DLL, and it exists in myC:\Windows\System32\
folder. If I askld
to also search in that folder, by using abuild.rs
file:I can now build it just fine:
Would it be possible for
winapi-rs
to drop those auxilliary crates and just add theC:\\Windows\\System32\
folder to the native search dirs for MinGW? It would greatly simplify development.Note: the folders, on a 64-bit native Windows, are
\System32
for 64-bit DLLs and\SysWOW64
for 32-bit DLLs.The text was updated successfully, but these errors were encountered: