puhitaku / mtplvcap

Nikon to USB Webcam. Supports older models that Nikon WU does not. Windows/macOS/Linux. No HDMI capture dongle is needed. Ask me on Twitter @puhitaku
https://twitter.com/puhitaku
Other
258 stars 19 forks source link

dyld: Library not loaded: /usr/local/opt/libusb/lib/libusb-1.0.0.dylib on Apple Silicon computer #26

Closed javag97 closed 3 years ago

javag97 commented 3 years ago

Commands I ran through:

unzip mtplvcap_macos_amd64
cd mtplvcap_macos_amd64
./mtplvcap

After I accept the binary file to be used in Security Settings panel, I get:

dyld: Library not loaded: /usr/local/opt/libusb/lib/libusb-1.0.0.dylib
  Referenced from: [removed-path-but-this-is-in-my-downloads-directory]
  Reason: image not found
zsh: abort      ./mtplvcap

Also tried to build myself using source:

 CGO_CFLAGS='-Wno-deprecated-declarations' go build .

Where I get:

# pkg-config --cflags  -- libusb-1.0
Package libusb-1.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libusb-1.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libusb-1.0' found
pkg-config: exit status 1
# pkg-config --cflags  -- libusb-1.0
Package libusb-1.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libusb-1.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libusb-1.0' found
pkg-config: exit status 1

I see that brew installled version 1.0.24 of libusb on my computer, so I believe that's the problem. How would I go about fixing it?

puhitaku commented 3 years ago

@javag97 I successfully reproduced the issue on my MacBook Pro (Late 2020, M1). Since building it manually succeeds on my Mac, I didn't notice that the distributed binary does not work. Sorry for the inconvenience. I added a hand-crafted ARM64 build in the latest release.

Have you tried brew link? This will put symlinks where pkg-config can find.

$ brew link libusb
puhitaku commented 3 years ago

@javag97 Any update? I hope you got it working 😉

javag97 commented 3 years ago

Sorry for the delay! Let me try :-)