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