1 // Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 #![allow(non_snake_case)]
13 register_long_diagnostics
! {
15 A link name was given with an empty name. Erroneous code example:
18 #[link(name = "")] extern {} // error: #[link(name = "")] given with empty name
21 The rust compiler cannot link to an external library if you don't give it its
25 #[link(name = "some_lib")] extern {} // ok!
30 Linking with `kind=framework` is only supported when targeting OS X,
31 as frameworks are specific to that operating system.
33 Erroneous code example:
36 #[link(name = "FooCoreServices", kind = "framework")] extern {}
37 // OS used to compile is Linux for example
40 To solve this error you can use conditional compilation:
43 #[cfg_attr(target="macos", link(name = "FooCoreServices", kind = "framework"))]
47 See more: https://doc.rust-lang.org/book/conditional-compilation.html
51 An unknown "kind" was specified for a link attribute. Erroneous code example:
54 #[link(kind = "wonderful_unicorn")] extern {}
55 // error: unknown kind: `wonderful_unicorn`
58 Please specify a valid "kind" value, from one of the following:
65 A link was used without a name parameter. Erroneous code example:
68 #[link(kind = "dylib")] extern {}
69 // error: #[link(...)] specified without `name = "foo"`
72 Please add the name parameter to allow the rust compiler to find the library
76 #[link(kind = "dylib", name = "some_lib")] extern {} // ok!
81 A plugin/crate was declared but cannot be found. Erroneous code example:
85 #![plugin(cookie_monster)] // error: can't find crate for `cookie_monster`
86 extern crate cake_is_a_lie; // error: can't find crate for `cake_is_a_lie`
89 You need to link your code to the relevant crate in order to be able to use it
90 (through Cargo or the `-L` option of rustc example). Plugins are crates as
91 well, and you link to them the same way.
96 register_diagnostics
! {
97 E0456
, // plugin `..` is not available for triple `..`
98 E0457
, // plugin `..` only found in rlib format, but must be available...
99 E0514
, // metadata version mismatch
100 E0460
, // found possibly newer version of crate `..`
101 E0461
, // couldn't find crate `..` with expected target triple ..
102 E0462
, // found staticlib `..` instead of rlib or dylib
103 E0464
, // multiple matching crates for `..`
104 E0465
, // multiple .. candidates for `..` found
105 E0519
, // local crate and dependency have same (crate-name, disambiguator)
106 E0523
, // two dependencies have same (crate-name, disambiguator) but different SVH