]> git.proxmox.com Git - rustc.git/blob - compiler/rustc_error_codes/src/error_codes/E0455.md
New upstream version 1.51.0+dfsg1
[rustc.git] / compiler / rustc_error_codes / src / error_codes / E0455.md
1 Linking with `kind=framework` is only supported when targeting macOS,
2 as frameworks are specific to that operating system.
3
4 Erroneous code example:
5
6 ```ignore (should-compile_fail-but-cannot-doctest-conditionally-without-macos)
7 #[link(name = "FooCoreServices", kind = "framework")] extern "C" {}
8 // OS used to compile is Linux for example
9 ```
10
11 To solve this error you can use conditional compilation:
12
13 ```
14 #[cfg_attr(target="macos", link(name = "FooCoreServices", kind = "framework"))]
15 extern "C" {}
16 ```
17
18 Learn more in the [Conditional Compilation][conditional-compilation] section
19 of the Reference.
20
21 [conditional-compilation]: https://doc.rust-lang.org/reference/attributes.html#conditional-compilation