Closed
Description
fn main() {
println!("{}", unsafe { foo() });
}
#[link_name = "foobar"]
extern "C" {
fn foo() -> u32;
}
This fails to link with undefined reference to `foo'
, but it didn't even try to find any foobar
library.
With #[link(name = "foobar")]
, the error is the expected ld: cannot find -lfoobar
.
There are a few places in libstd
using #[link_name = "m"] extern {...}
, so I wonder if those actually have any effect either.