Skip to content

Latest commit

 

History

History
24 lines (18 loc) · 717 Bytes

File metadata and controls

24 lines (18 loc) · 717 Bytes

Linking with kind=framework is only supported when targeting macOS, as frameworks are specific to that operating system.

Erroneous code example:

#[link(name = "FooCoreServices", kind = "framework")] extern "C" {}
// OS used to compile is Linux for example

To solve this error you can use conditional compilation:

#[cfg_attr(
    target_os="macos",
    link(name = "FooCoreServices", kind = "framework")
)]
extern "C" {}

Learn more in the Conditional Compilation section of the Reference.