Closed
Description
Lets say you've got an extern module called 'X':
#[link_name = "MY_LIBRARY_LINK_NAME"]
#[link_args="-L/path/to/your/library/x"]
pub extern mod X {
fn foo();
}
And files A, B, and C (lets say they define tests, or something), in a structure something like this:
/ ->
test ->
a.rs
b.rs
c.rs
lib ->
x.rs
If one was to define B and C like so to load module X:
b.rs:
#[path = '../lib/x.rs']
mod x;
//and some test functions
c.rs:
#[path = '../lib/x.rs']
mod x;
//and some test functions
And then include both in 'a.rs'
a.rs:
mod a;
mod b;
The compiler would throw an error such as:
x.rs:0:0: 0:1 error: library 'MY_LIBRARY_LINK_NAME' already added: can't specify link_args.