gphoto2 icon indicating copy to clipboard operation
gphoto2 copied to clipboard

'usb.h' file not found

Open oumingjiang opened this issue 2 years ago • 5 comments

I encountered an error when mixing with Android studio, I want to connect the camera through the mobile phone USB and get the photos in the camera, I add the libgphoto2_port/usb/libusb.c file in CMakelists.txt When compiling, in libusb.c# include <usb.h> The usb.h file cannot be found. Has anyone done this, please help me, thank you very much

oumingjiang avatar Apr 25 '22 03:04 oumingjiang

You need to build with the libusb development package + headers. preferably the libusb 1 ones. (not libusb 0.x whic hhad usb.h)

Not sure how to get that on Android.

msmeissn avatar Apr 27 '22 07:04 msmeissn

您需要使用 libusb 开发包 + 头文件进行构建。最好是 libusb 1 的。(不是带有 usb.h 的 libusb 0.x)

不知道如何在Android上获得它。

  1. Do I have to integrate libusb library if I need to link the camera via USB?
  2. If the libusb library has been compiled, how should I make libusb interact with gphoto2 in Android?

oumingjiang avatar Apr 27 '22 07:04 oumingjiang

yes, libgphoto2 needs libusb0 or libusb1 to be able to accept USB cameras.

libgphoto2 links against libusb during build.

msmeissn avatar Apr 27 '22 07:04 msmeissn

Thank you, I integrated libusb debugging to see.

是的,libgphoto2 需要 libusb0 或 libusb1 才能接受 USB 摄像头。

libgphoto2 在构建期间链接到 libusb。

Thank you, I integrated libusb debugging to see.

oumingjiang avatar Apr 27 '22 07:04 oumingjiang

谢谢,我集成libusb调试看看。

是的,libgphoto2 需要 libusb0 或 libusb1 才能接受 USB 摄像头。 libgphoto2 在制作期间链接到 libusb。

谢谢,我集成libusb调试看看。

Hello, I tried to compile libusb separately, it was successful and I can call libusb's API, but I don't know how to communicate with gphoto2. Will the libusb library be integrated if I compile the gphoto2 source with ubuntu? So how do I compile to get the so files of arm64-v8a, armeabi-v7a, x86, x86_64 that Android wants?

oumingjiang avatar May 10 '22 14:05 oumingjiang