Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not compile user-notifications feature. #23

Open
PfisterFactor opened this issue Jan 13, 2022 · 2 comments
Open

Could not compile user-notifications feature. #23

PfisterFactor opened this issue Jan 13, 2022 · 2 comments

Comments

@PfisterFactor
Copy link

Compiling below (cargo build):

# Cargo.toml
[dependencies]
cacao = {version = "0.2.1", features = ["user-notifications"]}
// main.rs
use cacao::macos::{App, window::Window, AppDelegate};
use cacao::notification_center;


#[derive(Default)]
struct BasicApp {
    window: Window
}

impl AppDelegate for BasicApp {
    fn did_finish_launching(&self) {
        self.window.set_minimum_content_size(400., 400.);
        self.window.set_title("Hello World!");
        self.window.show();
        
    }
}

fn main() {
    App::new("com.hello.world", BasicApp::default()).run();
}

leads to the following errors:

❯ cargo build
   Compiling cacao v0.2.1
error[E0599]: no function or associated item named `wrap` found for struct `NSString<'_>` in the current scope
  --> /Users/ej/.cargo/registry/src/github.com-1ecc6299db9ec823/cacao-0.2.1/src/user_notifications/mod.rs:29:55
   |
29 |                 let localized_description = NSString::wrap(msg_send![error, localizedDescription]); 
   |                                                       ^^^^ function or associated item not found in `NSString<'_>`
   |
  ::: /Users/ej/.cargo/registry/src/github.com-1ecc6299db9ec823/cacao-0.2.1/src/foundation/string.rs:19:1
   |
19 | pub struct NSString<'a> {
   | ----------------------- function or associated item `wrap` not found for this

For more information about this error, try `rustc --explain E0599`.
error: could not compile `cacao` due to previous error

I am on a M1 Macbook Pro (2021, 14-inch) running MacOS Monterey using stable-aarch64-apple-darwin. stable-x86_64-apple-darwin produces the same result.

@PfisterFactor
Copy link
Author

PfisterFactor commented Jan 13, 2022

Of note that building with the "airyx-appkit-uikit-features" (and changing to the appkit module) fixed this error

[dependencies]
cacao = {git = "https://github.com/ryanmcgrath/cacao.git", branch="airyx-appkit-uikit-features", features = ["user-notifications"]}

@ryanmcgrath
Copy link
Owner

ryanmcgrath commented Jan 13, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants