Rollup merge of #103000 - wesleywiser:suggest_libname, r=compiler-errors
Add suggestion to the "missing native library" error If we fail to locate a native library that we are linking with, it could be the case the user entered a complete file name like `foo.lib` or `libfoo.a` when we expect them to simply provide `foo`. In this situation, we now detect that case and suggest the user only provide the library name itself.
This commit is contained in:
commit
c7f048ea00
7 changed files with 68 additions and 2 deletions
|
|
@ -0,0 +1,9 @@
|
|||
// build-fail
|
||||
// compile-flags: --crate-type rlib
|
||||
// error-pattern: could not find native static library `libfoo.a`
|
||||
// error-pattern: only provide the library name `foo`, not the full filename
|
||||
|
||||
#[link(name = "libfoo.a", kind = "static")]
|
||||
extern { }
|
||||
|
||||
pub fn main() { }
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
error: could not find native static library `libfoo.a`, perhaps an -L flag is missing?
|
||||
|
|
||||
= help: only provide the library name `foo`, not the full filename
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
// build-fail
|
||||
// compile-flags: --crate-type rlib
|
||||
// error-pattern: could not find native static library `bar.lib`
|
||||
// error-pattern: only provide the library name `bar`, not the full filename
|
||||
|
||||
#[link(name = "bar.lib", kind = "static")]
|
||||
extern { }
|
||||
|
||||
pub fn main() { }
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
error: could not find native static library `bar.lib`, perhaps an -L flag is missing?
|
||||
|
|
||||
= help: only provide the library name `bar`, not the full filename
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue