-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Need support Windows-style DLL export function names #14559
Comments
it's stdcall symbol decoration. Win32 stdcall requires symbol exported as |
It's just that dependency walker understands stdcall convention.
Indeed gcc also adds
|
Closing, it sounds like this is normal behavior. |
@alexcrichton @klutzy You misunderstand. |
Do you have some example code which does not work as expected? If C++ is doing the same thing it seems like there's no bug here. |
Ok, I now understand what you mean: you want symbol dllexported as other name. However this is usually done by linker and no language support is required, even on C/C++.
then However, we don't explicitly export symbols so adding .def files will cause other pub symbols not exported. This should be fixed - see #7196. (Or, the easiest solution is using |
Let's leave C/C++ aside, we talk about Rust: How to do it? (and can we make it easier?) |
Basically same: you can write .def file and give it to linker.
(but this currently causes other symbols not exported as described at #7196) |
Rust: (compile to a DLL)
C/C++ (or others):
I expect that Rust DLL export a function named "add" (not "add@x"), and can be load by this name in other languages. Most 3rd plugin systems expected this, such as Lua extensions. NOTE: I'm not filing a bug (I don't think there is a bug), I'm asking for new feature. |
@klutzy Thank you! I tried it, and it works. |
internal: Skip code lens resolution for mismatched document versions Closes rust-lang/rust-analyzer#12718
After compiled to DLL, the exported function name is
add@8
.But we need a way to export it as
add
(instead of add@x).Most Windows API are named without "@x".
The text was updated successfully, but these errors were encountered: