Skip to content
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

Doucment how raw-dylib finds DLLs at runtime #1398

Open
FreddyDgh opened this issue Sep 2, 2023 · 1 comment
Open

Doucment how raw-dylib finds DLLs at runtime #1398

FreddyDgh opened this issue Sep 2, 2023 · 1 comment

Comments

@FreddyDgh
Copy link

Was trying to use the 'raw-dylib' feature and found that things didn't quite work as I expected. Perhaps the following clarifications could be added to the docs?

  • When using 'raw-dylib', where does Rust look for the DLLs at runtime?
  • Can that lookup behavior be changed? For example, if I have the DLLs in a subdirectory instead of directly next to the executable, can I tell this to the compiler somehow?

Specifying `kind = "dylib"` instructs the Rust compiler to link an import
library based on the `name` key. The linker will then use its normal library
resolution logic to find that import library. Alternatively, specifying
`kind = "raw-dylib"` instructs the compiler to generate an import library
during compilation and provide that to the linker instead.
`raw-dylib` is only supported on Windows. Using it when targeting other
platforms will result in a compiler error.

@bjorn3
Copy link
Member

bjorn3 commented Sep 2, 2023

Windows doesn't support rpath, so you can't configure where dll's are looked up other than by changing PATH before starting the program. Windows will look for dll's right next to the executable as well as in all the directories referenced by PATH.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants