kamaaina / macropad_tool

tool to program a macropad
50 stars 6 forks source link

libusb architecture error when compiling on mac arm64 #29

Closed tg44 closed 2 months ago

tg44 commented 3 months ago

I get ld: warning: ignoring file '/opt/homebrew/Cellar/libusb/1.0.27/lib/libusb-1.0.0.dylib': found architecture 'arm64', required architecture 'x86_64' when I try to build.

Is there any idea, how can I solve this problem? I tried to reinstall libusb. Also, googling did not helped me.

kamaaina commented 3 months ago

try deleting your Cargo.lock file and rebuilding

kamaaina commented 2 months ago

@tg44 were you able to build?

tg44 commented 2 months ago

Nope, it is the same, after I deleted the Cargo.lock, the regenerated (updated) version has no version changes with libusb.

BUT this worked;

rustup target add aarch64-apple-darwin
cargo build --release --target=aarch64-apple-darwin
target/aarch64-apple-darwin/release/macropad-tool validate -h

So for some reasons, I needed to explicitly tell the rust compiler to compile against apple silicon even if I'm on apple silicon...