Open johansmolinski opened 3 months ago
Possible regression of https://github.com/raspberrypi/usbboot/pull/206/files#diff-a0cb465674c1b01a07d361f25a0ef2b0214b7dfe9412b7777f89add956da10ecR1
Try if it works with the simple 'libusb.h' include.
Yes. As mentioned, I already tried that as a workaround. Got it working. Just added this ticket to save some time for the next fella. :)
I see the same problem on Mac with libusb-1.0 installed by Homebrew, and changing the include to 'libusb.h' works around it successfully.
It behaves a little bit different on Apple Silicon macs, since Homebrew installs in /opt/homebrew/opt/
. If Itry the commands from @johansmolinski I'm getting this:
export PKG_CONFIG_PATH="$(brew --prefix libusb)/lib/pkgconfig"
pkg-config --cflags libusb-1.0
-I/opt/homebrew/Cellar/libusb/1.0.27/include/libusb-1.0
ls /opt/homebrew/Cellar/libusb/1.0.27/include/libusb-1.0
libusb.h
But with the change to the main.c
its also working on my machine.
changing #include <libusb-1.0/libusb.h>
to #include <libusb.h>
works on M1 brew
Any comments, @tdewey-rpi?
Interesting that on my M1 MBP I required this the other way around. Happy to accept the change, but I build this as-is without issue.
Edit: found my culprit, I have libusb-1.0.26 linked into a common headers area. Not entirely clear where that's come from.
Describe the bug
Building for macOS following the instructions fails on finding
libusb-1.0/libusb.h
. Reason is thatmain.c
includeslibusb-1.0/libusb.h
where it should includelibusb.h
.Steps to reproduce the behaviour
The reason being
main.c
is includinglibusb-1.0/libusb.h
. Changing to includelibusb.h
works. Here is an analysis of the reason:Note that the last line in the output above is
libusb.h
and notlibusb-1.0/libusb.h
.Device(s)
Other
Compute Module IO board.
No response
RPIBOOT logs
No response
Kernel logs
No response
Device UART logs
No response