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

dyld: Library not loaded: @rpath/libui.A.dylib error on macOS #91

Open
hanckmann opened this issue Jun 23, 2020 · 0 comments
Open

dyld: Library not loaded: @rpath/libui.A.dylib error on macOS #91

hanckmann opened this issue Jun 23, 2020 · 0 comments

Comments

@hanckmann
Copy link

hanckmann commented Jun 23, 2020

Building on macOS failes.

Details on maxOS:
ProductName: Mac OS X
ProductVersion: 10.15.5
BuildVersion: 19F101

Details on rust:
Default host: x86_64-apple-darwin
stable-x86_64-apple-darwin (default)

Cmake installation:
cmake version 3.17.2
(installed via nix package manager)

I performed a clean checkout from githubs master branch:

λ ~/Projects/ rm -rf libui-rs
λ ~/Projects/ git clone https://github.com/rust-native-ui/libui-rs.git
Cloning into 'libui-rs'...
remote: Enumerating objects: 29, done.
remote: Counting objects: 100% (29/29), done.
remote: Compressing objects: 100% (25/25), done.
remote: Total 13463 (delta 11), reused 16 (delta 4), pack-reused 13434
Receiving objects: 100% (13463/13463), 6.84 MiB | 7.57 MiB/s, done.
Resolving deltas: 100% (8608/8608), done.

This is the output of cargo build --examples:

λ ~/Projects/libui-rs/ master cargo build --examples
    Updating crates.io index
   Compiling libc v0.2.71
   Compiling memchr v2.3.3
   Compiling cfg-if v0.1.10
   Compiling lazy_static v1.4.0
   Compiling log v0.4.8
   Compiling glob v0.2.11
   Compiling bitflags v1.2.1
   Compiling regex v0.2.11
   Compiling ucd-util v0.1.8
   Compiling proc-macro2 v1.0.18
   Compiling libloading v0.4.3
   Compiling unicode-xid v0.2.0
   Compiling unicode-width v0.1.7
   Compiling utf8-ranges v1.0.4
   Compiling ansi_term v0.11.0
   Compiling vec_map v0.8.2
   Compiling bindgen v0.31.3
   Compiling syn v1.0.33
   Compiling strsim v0.8.0
   Compiling quote v0.3.15
   Compiling peeking_take_while v0.1.2
   Compiling cc v1.0.54
   Compiling lazy_static v0.2.11
   Compiling failure_derive v0.1.8
   Compiling adler32 v1.1.0
   Compiling gimli v0.21.0
   Compiling rustc-demangle v0.1.16
   Compiling object v0.20.0
   Compiling thread_local v0.3.6
   Compiling regex-syntax v0.5.6
   Compiling textwrap v0.11.0
   Compiling clang-sys v0.21.2
   Compiling miniz_oxide v0.3.7
   Compiling cmake v0.1.44
   Compiling addr2line v0.12.2
   Compiling log v0.3.9
   Compiling aho-corasick v0.6.10
   Compiling memchr v1.0.2
   Compiling atty v0.2.14
   Compiling which v1.0.5
   Compiling backtrace v0.3.49
   Compiling quote v1.0.7
   Compiling nom v3.2.1
   Compiling clap v2.33.1
   Compiling cexpr v0.2.3
   Compiling env_logger v0.4.3
   Compiling synstructure v0.12.4
   Compiling failure v0.1.8
   Compiling ui-sys v0.2.1 (/Users/patrick/Projects/libui-rs/ui-sys)
   Compiling iui v0.3.0 (/Users/patrick/Projects/libui-rs/iui)
warning: trait objects without an explicit `dyn` are deprecated
  --> iui/src/controls/basic.rs:54:35
   |
54 |             let mut data: Box<Box<FnMut(&mut Button)>> = Box::new(Box::new(callback));
   |                                   ^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn FnMut(&mut Button)`
   |
   = note: `#[warn(bare_trait_objects)]` on by default

warning: trait objects without an explicit `dyn` are deprecated
  --> iui/src/controls/basic.rs:58:40
   |
58 |                 &mut *data as *mut Box<FnMut(&mut Button)> as *mut c_void,
   |                                        ^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn FnMut(&mut Button)`

warning: trait objects without an explicit `dyn` are deprecated
  --> iui/src/controls/basic.rs:66:56
   |
66 |                 mem::transmute::<*mut c_void, &mut Box<FnMut(&mut Button)>>(data)(&mut button)
   |                                                        ^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn FnMut(&mut Button)`

warning: trait objects without an explicit `dyn` are deprecated
  --> iui/src/controls/window.rs:92:35
   |
92 |             let mut data: Box<Box<FnMut(&mut Window) -> bool>> = Box::new(Box::new(|window| {
   |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn FnMut(&mut Window) -> bool`

warning: trait objects without an explicit `dyn` are deprecated
  --> iui/src/controls/window.rs:99:40
   |
99 |                 &mut *data as *mut Box<FnMut(&mut Window) -> bool> as *mut c_void,
   |                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn FnMut(&mut Window) -> bool`

warning: trait objects without an explicit `dyn` are deprecated
   --> iui/src/controls/window.rs:107:55
    |
107 |                 mem::transmute::<*mut c_void, Box<Box<FnMut(&mut Window) -> bool>>>(data)(
    |                                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn FnMut(&mut Window) -> bool`

warning: trait objects without an explicit `dyn` are deprecated
  --> iui/src/controls/entry.rs:68:35
   |
68 |             let mut data: Box<Box<FnMut(i32)>> = Box::new(Box::new(callback));
   |                                   ^^^^^^^^^^ help: use `dyn`: `dyn FnMut(i32)`

warning: trait objects without an explicit `dyn` are deprecated
  --> iui/src/controls/entry.rs:72:40
   |
72 |                 &mut *data as *mut Box<FnMut(i32)> as *mut c_void,
   |                                        ^^^^^^^^^^ help: use `dyn`: `dyn FnMut(i32)`

warning: trait objects without an explicit `dyn` are deprecated
  --> iui/src/controls/entry.rs:80:56
   |
80 |                 mem::transmute::<*mut c_void, &mut Box<FnMut(i32)>>(data)(val);
   |                                                        ^^^^^^^^^^ help: use `dyn`: `dyn FnMut(i32)`

warning: trait objects without an explicit `dyn` are deprecated
  --> iui/src/controls/entry.rs:97:35
   |
97 |             let mut data: Box<Box<FnMut(i32)>> = Box::new(Box::new(callback));
   |                                   ^^^^^^^^^^ help: use `dyn`: `dyn FnMut(i32)`

warning: trait objects without an explicit `dyn` are deprecated
   --> iui/src/controls/entry.rs:101:40
    |
101 |                 &mut *data as *mut Box<FnMut(i32)> as *mut c_void,
    |                                        ^^^^^^^^^^ help: use `dyn`: `dyn FnMut(i32)`

warning: trait objects without an explicit `dyn` are deprecated
   --> iui/src/controls/entry.rs:109:56
    |
109 |                 mem::transmute::<*mut c_void, &mut Box<FnMut(i32)>>(data)(val);
    |                                                        ^^^^^^^^^^ help: use `dyn`: `dyn FnMut(i32)`

warning: trait objects without an explicit `dyn` are deprecated
   --> iui/src/controls/entry.rs:166:35
    |
166 |             let mut data: Box<Box<FnMut(String)>> = Box::new(Box::new(callback));
    |                                   ^^^^^^^^^^^^^ help: use `dyn`: `dyn FnMut(String)`

warning: trait objects without an explicit `dyn` are deprecated
   --> iui/src/controls/entry.rs:170:40
    |
170 |                 &mut *data as *mut Box<FnMut(String)> as *mut c_void,
    |                                        ^^^^^^^^^^^^^ help: use `dyn`: `dyn FnMut(String)`

warning: trait objects without an explicit `dyn` are deprecated
   --> iui/src/controls/entry.rs:180:56
    |
180 |                 mem::transmute::<*mut c_void, &mut Box<FnMut(String)>>(data)(string);
    |                                                        ^^^^^^^^^^^^^ help: use `dyn`: `dyn FnMut(String)`

warning: trait objects without an explicit `dyn` are deprecated
   --> iui/src/controls/entry.rs:202:35
    |
202 |             let mut data: Box<Box<FnMut(String)>> = Box::new(Box::new(callback));
    |                                   ^^^^^^^^^^^^^ help: use `dyn`: `dyn FnMut(String)`

warning: trait objects without an explicit `dyn` are deprecated
   --> iui/src/controls/entry.rs:206:40
    |
206 |                 &mut *data as *mut Box<FnMut(String)> as *mut c_void,
    |                                        ^^^^^^^^^^^^^ help: use `dyn`: `dyn FnMut(String)`

warning: trait objects without an explicit `dyn` are deprecated
   --> iui/src/controls/entry.rs:216:56
    |
216 |                 mem::transmute::<*mut c_void, &mut Box<FnMut(String)>>(data)(string);
    |                                                        ^^^^^^^^^^^^^ help: use `dyn`: `dyn FnMut(String)`

warning: trait objects without an explicit `dyn` are deprecated
   --> iui/src/controls/entry.rs:238:35
    |
238 |             let mut data: Box<Box<FnMut(String)>> = Box::new(Box::new(callback));
    |                                   ^^^^^^^^^^^^^ help: use `dyn`: `dyn FnMut(String)`

warning: trait objects without an explicit `dyn` are deprecated
   --> iui/src/controls/entry.rs:242:40
    |
242 |                 &mut *data as *mut Box<FnMut(String)> as *mut c_void,
    |                                        ^^^^^^^^^^^^^ help: use `dyn`: `dyn FnMut(String)`

warning: trait objects without an explicit `dyn` are deprecated
   --> iui/src/controls/entry.rs:252:56
    |
252 |                 mem::transmute::<*mut c_void, &mut Box<FnMut(String)>>(data)(string);
    |                                                        ^^^^^^^^^^^^^ help: use `dyn`: `dyn FnMut(String)`

warning: trait objects without an explicit `dyn` are deprecated
   --> iui/src/controls/entry.rs:290:35
    |
290 |             let mut data: Box<Box<FnMut(i32)>> = Box::new(Box::new(callback));
    |                                   ^^^^^^^^^^ help: use `dyn`: `dyn FnMut(i32)`

warning: trait objects without an explicit `dyn` are deprecated
   --> iui/src/controls/entry.rs:294:40
    |
294 |                 &mut *data as *mut Box<FnMut(i32)> as *mut c_void,
    |                                        ^^^^^^^^^^ help: use `dyn`: `dyn FnMut(i32)`

warning: trait objects without an explicit `dyn` are deprecated
   --> iui/src/controls/entry.rs:302:56
    |
302 |                 mem::transmute::<*mut c_void, &mut Box<FnMut(i32)>>(data)(val);
    |                                                        ^^^^^^^^^^ help: use `dyn`: `dyn FnMut(i32)`

warning: trait objects without an explicit `dyn` are deprecated
   --> iui/src/controls/entry.rs:331:35
    |
331 |             let mut data: Box<Box<FnMut(bool)>> = Box::new(Box::new(callback));
    |                                   ^^^^^^^^^^^ help: use `dyn`: `dyn FnMut(bool)`

warning: trait objects without an explicit `dyn` are deprecated
   --> iui/src/controls/entry.rs:335:40
    |
335 |                 &mut *data as *mut Box<FnMut(bool)> as *mut c_void,
    |                                        ^^^^^^^^^^^ help: use `dyn`: `dyn FnMut(bool)`

warning: trait objects without an explicit `dyn` are deprecated
   --> iui/src/controls/entry.rs:343:56
    |
343 |                 mem::transmute::<*mut c_void, &mut Box<FnMut(bool)>>(data)(val);
    |                                                        ^^^^^^^^^^^ help: use `dyn`: `dyn FnMut(bool)`

warning: trait objects without an explicit `dyn` are deprecated
   --> iui/src/controls/entry.rs:375:35
    |
375 |             let mut data: Box<Box<FnMut(i32)>> = Box::new(Box::new(callback));
    |                                   ^^^^^^^^^^ help: use `dyn`: `dyn FnMut(i32)`

warning: trait objects without an explicit `dyn` are deprecated
   --> iui/src/controls/entry.rs:379:40
    |
379 |                 &mut *data as *mut Box<FnMut(i32)> as *mut c_void,
    |                                        ^^^^^^^^^^ help: use `dyn`: `dyn FnMut(i32)`

warning: trait objects without an explicit `dyn` are deprecated
   --> iui/src/controls/entry.rs:387:56
    |
387 |                 mem::transmute::<*mut c_void, &mut Box<FnMut(i32)>>(data)(val);
    |                                                        ^^^^^^^^^^ help: use `dyn`: `dyn FnMut(i32)`

warning: trait objects without an explicit `dyn` are deprecated
  --> iui/src/controls/area.rs:26:23
   |
26 |     trait_object: Box<AreaHandler>,
   |                       ^^^^^^^^^^^ help: use `dyn`: `dyn AreaHandler`

warning: trait objects without an explicit `dyn` are deprecated
  --> iui/src/controls/area.rs:30:41
   |
30 |     fn new(_ctx: &UI, trait_object: Box<AreaHandler>) -> Box<RustAreaHandler> {
   |                                         ^^^^^^^^^^^ help: use `dyn`: `dyn AreaHandler`

warning: trait objects without an explicit `dyn` are deprecated
   --> iui/src/controls/area.rs:151:44
    |
151 |     pub fn new(ctx: &UI, area_handler: Box<AreaHandler>) -> Area {
    |                                            ^^^^^^^^^^^ help: use `dyn`: `dyn AreaHandler`

warning: trait objects without an explicit `dyn` are deprecated
   --> iui/src/controls/area.rs:165:27
    |
165 |         area_handler: Box<AreaHandler>,
    |                           ^^^^^^^^^^^ help: use `dyn`: `dyn AreaHandler`

warning: trait objects without an explicit `dyn` are deprecated
  --> iui/src/menus.rs:51:35
   |
51 |             let mut data: Box<Box<FnMut(&MenuItem, &Window)>> = Box::new(Box::new(callback));
   |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn FnMut(&MenuItem, &Window)`

warning: trait objects without an explicit `dyn` are deprecated
  --> iui/src/menus.rs:55:40
   |
55 |                 &mut *data as *mut Box<FnMut(&MenuItem, &Window)> as *mut c_void,
   |                                        ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn FnMut(&MenuItem, &Window)`

warning: trait objects without an explicit `dyn` are deprecated
  --> iui/src/menus.rs:70:56
   |
70 |                 mem::transmute::<*mut c_void, &mut Box<FnMut(&MenuItem, &Window)>>(data)(
   |                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn FnMut(&MenuItem, &Window)`

warning: trait objects without an explicit `dyn` are deprecated
   --> iui/src/ui.rs:138:35
    |
138 |             let mut data: Box<Box<FnMut()>> = Box::new(Box::new(callback));
    |                                   ^^^^^^^ help: use `dyn`: `dyn FnMut()`

warning: trait objects without an explicit `dyn` are deprecated
   --> iui/src/ui.rs:141:40
    |
141 |                 &mut *data as *mut Box<FnMut()> as *mut c_void,
    |                                        ^^^^^^^ help: use `dyn`: `dyn FnMut()`

warning: trait objects without an explicit `dyn` are deprecated
   --> iui/src/ui.rs:150:35
    |
150 |             let mut data: Box<Box<FnMut()>> = Box::new(Box::new(callback));
    |                                   ^^^^^^^ help: use `dyn`: `dyn FnMut()`

warning: trait objects without an explicit `dyn` are deprecated
   --> iui/src/ui.rs:153:40
    |
153 |                 &mut *data as *mut Box<FnMut()> as *mut c_void,
    |                                        ^^^^^^^ help: use `dyn`: `dyn FnMut()`

warning: trait objects without an explicit `dyn` are deprecated
   --> iui/src/ui.rs:170:26
    |
170 |     callback: Option<Box<FnMut() + 's>>,
    |                          ^^^^^^^^^^^^ help: use `dyn`: `dyn FnMut() + 's`

warning: use of deprecated item 'std::mem::uninitialized': use `mem::MaybeUninit` instead
  --> iui/src/draw/transform.rs:22:30
   |
22 |             let mut matrix = mem::uninitialized();
   |                              ^^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(deprecated)]` on by default

warning: use of deprecated item 'std::sync::atomic::ATOMIC_BOOL_INIT': the `new` function is now preferred
 --> iui/src/ffi_tools.rs:2:47
  |
2 | use std::sync::atomic::{AtomicBool, Ordering, ATOMIC_BOOL_INIT};
  |                                               ^^^^^^^^^^^^^^^^

warning: use of deprecated item 'std::sync::atomic::ATOMIC_BOOL_INIT': the `new` function is now preferred
 --> iui/src/ffi_tools.rs:4:34
  |
4 | static INITIALIZED: AtomicBool = ATOMIC_BOOL_INIT;
  |                                  ^^^^^^^^^^^^^^^^ help: replace the use of the deprecated item: `AtomicBool::new(false)`

warning: 45 warnings emitted

warning: use of deprecated item 'std::error::Error::description': use the Display impl or to_string()
  --> iui/examples/files.rs:35:129
   |
35 |                     Err(why) => { window.modal_err(&ui, "I/O Error", &format!("Could not open file {}: {}", path.display(), why.description())); return; }
   |                                                                                                                                 ^^^^^^^^^^^
   |
   = note: `#[warn(deprecated)]` on by default

warning: use of deprecated item 'std::error::Error::description': use the Display impl or to_string()
  --> iui/examples/files.rs:39:133
   |
39 |                     Err(why) => { window.modal_err(&ui, "I/O Error", &format!("Could not write to file {}: {}", path.display(), why.description())); return; }
   |                                                                                                                                     ^^^^^^^^^^^

warning: 2 warnings emitted

    Finished dev [unoptimized + debuginfo] target(s) in 1m 49s

This is the output of running the basic example:

λ ~/Projects/libui-rs/ master ./target/debug/examples/basic
dyld: Library not loaded: @rpath/libui.A.dylib
  Referenced from: /Users/patrick/Projects/libui-rs/./target/debug/examples/basic
  Reason: image not found
[1]    32997 abort      ./target/debug/examples/basic
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

1 participant