-
Notifications
You must be signed in to change notification settings - Fork 285
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
Linking against a DLL file #271
Comments
Nope, for the reason you mention. It goes further than node-gyp: node.exe is compiled with cl.exe and cl.exe does name mangling differently than mingw. clang-cl might work, though.
The first four look like you linked in code intended for POSIX platforms (i.e., non-Windows.) The
No, although you could perhaps load the DLL and look up symbols dynamically. Rather less convenient though. |
Thanks, your answers help a lot (and make it clear which direction I need to go in). Do you know of a way to tell rustc to pass |
No idea, sorry. |
You might find something useful in this thread. Sorry if I've misunderstood your use case, since it does say "linker arguments". rust-lang/rfcs#1766 |
This might also be worth looking at since it looks like it lets you set |
Thanks for the help! |
Hello. Thanks for this project! So far it seems really cool. I have a weird dilemma I'm hoping you can help out with.
I have a somewhat largish rust app (called Turtl) I'm building with the rust windows GNU toolchain. It needs to compile against gnu (I'm on msys2/mingw64) because some of the dependencies won't compile on msvc. Since Neon requires the msvc toolchain (as far as I can tell), I unfortunately can't directly load my crate into the neon plugin under the
[dependencies]
. I've decided instead to compile my project to a library (.dll/.lib) that exposes a C api and call out to it from generated bindings.I have two problems at this point.
When Neon links against my library file, it seems to only look for the static lib (
turtl_core.lib
). Ok, fine, I compile turtl as a static library, which Neon finds when compiling, but I get this error:I've been looking everywhere online and haven't found a solution, and no matter what combination of
-l<lib>
I use inRUSTFLAGS
I still get these errors.So now, I'm thinking maybe it would be more effective to compile turtl to a
.dll
instead, but I'm having trouble telling Neon to look for a DLL instead of a LIB. I tried a number of different combinations of things inbuild.rs
in the neon project, but no luck.I'm wondering three things:
Thanks so much for your help!
The text was updated successfully, but these errors were encountered: