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

Linker error when compiling basic example on arm64 macOS (Apple Silicon) #129

Open
fwcd opened this issue Feb 17, 2023 · 2 comments · May be fixed by #130
Open

Linker error when compiling basic example on arm64 macOS (Apple Silicon) #129

fwcd opened this issue Feb 17, 2023 · 2 comments · May be fixed by #130

Comments

@fwcd
Copy link

fwcd commented Feb 17, 2023

Running cargo run --example basic fails with

Compiling iui v0.3.0 (/Users/<USER>/git/libui-rs/iui)
error: linking with `cc` failed: exit status: 1
  |
  = note: "cc" "-arch" "arm64" "/var/folders/bp/fvm0x9c92xb3x02w8qsg21jh0000gn/T/rustcKwuGFH/symbols.o" "/Users/<USER>/git/libui-rs/target/debug/examples/basic-30c3e9d504c70d07.1eg50zitgxgbicbn.rcgu.o" "/Users/<USER>/git/libui-rs/target/debug/examples/basic-30c3e9d504c70d07.1hzmr3kmtdl4bpu6.rcgu.o" "/Users/<USER>/git/libui-rs/target/debug/examples/basic-30c3e9d504c70d07.1waonrue2ebuqotl.rcgu.o" "/Users/<USER>/git/libui-rs/target/debug/examples/basic-30c3e9d504c70d07.20ztt15mm307dcuu.rcgu.o" "/Users/<USER>/git/libui-rs/target/debug/examples/basic-30c3e9d504c70d07.28ai7bk0ozpb747k.rcgu.o" "/Users/<USER>/git/libui-rs/target/debug/examples/basic-30c3e9d504c70d07.2bwmwf0y9h1kvb7i.rcgu.o" "/Users/<USER>/git/libui-rs/target/debug/examples/basic-30c3e9d504c70d07.2jgg6gvqkej70ken.rcgu.o" "/Users/<USER>/git/libui-rs/target/debug/examples/basic-30c3e9d504c70d07.2m250s2nyall65sk.rcgu.o" "/Users/<USER>/git/libui-rs/target/debug/examples/basic-30c3e9d504c70d07.2rb0l2rzwr6qiymd.rcgu.o" "/Users/<USER>/git/libui-rs/target/debug/examples/basic-30c3e9d504c70d07.36o0ci94gohjhfu3.rcgu.o" "/Users/<USER>/git/libui-rs/target/debug/examples/basic-30c3e9d504c70d07.3f8kd3sucr20xwpv.rcgu.o" "/Users/<USER>/git/libui-rs/target/debug/examples/basic-30c3e9d504c70d07.3mzql2h5s6w62lms.rcgu.o" "/Users/<USER>/git/libui-rs/target/debug/examples/basic-30c3e9d504c70d07.4het468j4pimbdd0.rcgu.o" "/Users/<USER>/git/libui-rs/target/debug/examples/basic-30c3e9d504c70d07.4jfrlt2v0z6ewcf7.rcgu.o" "/Users/<USER>/git/libui-rs/target/debug/examples/basic-30c3e9d504c70d07.4juvumgh5opa9dbf.rcgu.o" "/Users/<USER>/git/libui-rs/target/debug/examples/basic-30c3e9d504c70d07.4kozp9viwoysmhvs.rcgu.o" "/Users/<USER>/git/libui-rs/target/debug/examples/basic-30c3e9d504c70d07.4moziqv3e6d97v9a.rcgu.o" "/Users/<USER>/git/libui-rs/target/debug/examples/basic-30c3e9d504c70d07.4tic7b0ypau0rz83.rcgu.o" "/Users/<USER>/git/libui-rs/target/debug/examples/basic-30c3e9d504c70d07.6498p94ltcsvyqy.rcgu.o" "/Users/<USER>/git/libui-rs/target/debug/examples/basic-30c3e9d504c70d07.r40mpuhpw4nyz8s.rcgu.o" "/Users/<USER>/git/libui-rs/target/debug/examples/basic-30c3e9d504c70d07.2yw09zevliiahdcj.rcgu.o" "-L" "/Users/<USER>/git/libui-rs/target/debug/deps" "-L" "/Users/<USER>/git/libui-rs/target/debug/build/ui-sys-ede8d110f88ed187/out" "-L" "/Users/<USER>/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib" "/Users/<USER>/git/libui-rs/target/debug/deps/libiui-c7a222012eaacb61.rlib" "/Users/<USER>/git/libui-rs/target/debug/deps/libui_sys-782b16aaf43ef527.rlib" "/Users/<USER>/git/libui-rs/target/debug/deps/libfailure-6174e4141902b113.rlib" "/Users/<USER>/git/libui-rs/target/debug/deps/libbacktrace-d3450263fd03ad97.rlib" "/Users/<USER>/git/libui-rs/target/debug/deps/libobject-bff620247865f019.rlib" "/Users/<USER>/git/libui-rs/target/debug/deps/libmemchr-6c9fbfeda127ffa9.rlib" "/Users/<USER>/git/libui-rs/target/debug/deps/liblibc-ef6cde88ceaed937.rlib" "/Users/<USER>/git/libui-rs/target/debug/deps/libaddr2line-6efda82b849ca163.rlib" "/Users/<USER>/git/libui-rs/target/debug/deps/libgimli-a73a1349c0cb74aa.rlib" "/Users/<USER>/git/libui-rs/target/debug/deps/libcfg_if-f043d77383bd547c.rlib" "/Users/<USER>/git/libui-rs/target/debug/deps/librustc_demangle-4adf5b50d94bbdd4.rlib" "/Users/<USER>/git/libui-rs/target/debug/deps/libbitflags-6db4b7a1a2354e6b.rlib" "/Users/<USER>/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libstd-8b48f6cefff7b1fb.rlib" "/Users/<USER>/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libpanic_unwind-77aeaad8f850e496.rlib" "/Users/<USER>/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libobject-4374cc9e76b48de5.rlib" "/Users/<USER>/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libmemchr-71ce82846aaede9b.rlib" "/Users/<USER>/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libaddr2line-88478a43231eec41.rlib" "/Users/<USER>/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libgimli-219a0c42f67a2534.rlib" "/Users/<USER>/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_demangle-967edde4cff44b15.rlib" "/Users/<USER>/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libstd_detect-5e9bad2c7ec1f53a.rlib" "/Users/<USER>/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcfg_if-f2d3de7828f2e1f2.rlib" "/Users/<USER>/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libhashbrown-39feb0179b2f197f.rlib" "/Users/<USER>/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libminiz_oxide-fe7523d51d4e2154.rlib" "/Users/<USER>/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libadler-1fb439e2b08a54ae.rlib" "/Users/<USER>/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_std_workspace_alloc-0ece1873dc3050cd.rlib" "/Users/<USER>/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libunwind-1094a874bdfc7dbb.rlib" "/Users/<USER>/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcfg_if-8cd76113b92d6775.rlib" "/Users/<USER>/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/liblibc-3a7cb21921429c0e.rlib" "/Users/<USER>/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/liballoc-5b42fb3902d391c7.rlib" "/Users/<USER>/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_std_workspace_core-b495777441600026.rlib" "/Users/<USER>/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcore-cba95c4386a21469.rlib" "/Users/<USER>/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcompiler_builtins-b8f163a13cf94b5d.rlib" "-framework" "AppKit" "-liconv" "-lSystem" "-lc" "-lm" "-L" "/Users/<USER>/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib" "-o" "/Users/<USER>/git/libui-rs/target/debug/examples/basic-30c3e9d504c70d07" "-Wl,-dead_strip" "-nodefaultlibs"
  = note: Undefined symbols for architecture arm64:
            "_uiprivSendKeyboardEditEvents", referenced from:
                -[uiprivApplicationClass sendEvent:] in libui_sys-782b16aaf43ef527.rlib(main.o)
          ld: symbol(s) not found for architecture arm64
          clang: error: linker command failed with exit code 1 (use -v to see invocation)
          

error: could not compile `iui` due to previous error
@nptr
Copy link
Contributor

nptr commented Feb 17, 2023

I think the script that builds libui-ng (https://github.com/rust-native-ui/libui-rs/blob/trunk/ui-sys/build.rs) needs to add "darwin/event.m" around line 261. That should contain the missing symbol.

Since I don't maintain this project but am just a user I can't provide an immediate fix to you. I suggest you fix it in your fork and make a PR. I'll do so eventually at least.

@fwcd
Copy link
Author

fwcd commented Feb 17, 2023

That solved it, thanks! I'll open a PR for that

@fwcd fwcd linked a pull request Feb 17, 2023 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants