File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,23 @@ but supporting the range of linking possibilities made available by other
55languages is important for Rust to achieve seamless interaction with native
66libraries.
77
8+ # Native libraries required by upstream crates
9+
10+ Sometimes an upstream Rust crate won't include an appropriate ` #[link(...)] `
11+ attribute to automatically link against a required natve library on your system.
12+ This can happen if libraries are named differently across platforms (so only
13+ you as the crate consumer know the actual name). To link against the appropriate
14+ library for your system, you can use the ` #[link(...)] ` attribute on an empty
15+ extern block:
16+
17+ ``` no_run
18+ extern crate foo;
19+
20+ #[link(name = "foonative3"]
21+ extern {}
22+ # fn main() {}
23+ ```
24+
825# Link args
926
1027There is one other way to tell rustc how to customize linking, and that is via
You can’t perform that action at this time.
0 commit comments