-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
rust bin do not support static and dynamic library #51600
Labels
A-linkage
Area: linking into static, shared libraries and binaries
Comments
See https://doc.rust-lang.org/reference/linkage.html Rust crates cannot link against |
is that possible to link as I met error with Running `rustc --crate-name mybin src/main.rs --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=83480335185a07f8 -C extra-filename=-83480335185a07f8 --out-dir D:\cargo_temp\temp1\target\debug\deps -C incremental=D:\cargo_temp\temp1\target\debug\incremental -L dependency=D:\cargo_temp\temp1\target\debug\deps --extern mylib=D:\cargo_temp\temp1\target\debug\deps\mylib.dll`
error: cannot satisfy dependencies so `std` only shows up once
|
= help: having upstream crates all available in one format will likely make this go away
error: cannot satisfy dependencies so `core` only shows up once
|
= help: having upstream crates all available in one format will likely make this go away
error: cannot satisfy dependencies so `compiler_builtins` only shows up once
|
= help: having upstream crates all available in one format will likely make this go away |
VikingMew
changed the title
rust bin do not support static library
rust bin do not support static and dynamic library
Jun 16, 2018
stokhos
added
the
A-linkage
Area: linking into static, shared libraries and binaries
label
Jun 17, 2018
Closing as a duplicate of #34909 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ref from the top answer of
https://stackoverflow.com/questions/26946646/rust-package-with-both-a-library-and-a-binary
this sample works fine, but it is not working when
crate-type = ["staticlib"]
is added into[lib]
cargo ver: cargo 1.28.0-nightly (c3b09c968 2018-05-27)
rust ver: rustc 1.28.0-nightly (5bf68db 2018-05-28)
The text was updated successfully, but these errors were encountered: