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

Libusb error while running make #12

Closed
shreyansgandhi opened this issue Jun 26, 2019 · 4 comments
Closed

Libusb error while running make #12

shreyansgandhi opened this issue Jun 26, 2019 · 4 comments
Labels
No issue This is not an issue

Comments

@shreyansgandhi
Copy link

[ 81%] Building CXX object openhantek/CMakeFiles/OpenHantek.dir/src/usb/uploadFirmware.cpp.o
/home/intellolabs/OpenHantek6022/openhantek/src/usb/uploadFirmware.cpp: In member function ‘bool UploadFirmware::startUpload(USBDevice*)’:
/home/intellolabs/OpenHantek6022/openhantek/src/usb/uploadFirmware.cpp:38:5: error: ‘libusb_set_auto_detach_kernel_driver’ was not declared in this scope
libusb_set_auto_detach_kernel_driver(handle, 1);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/intellolabs/OpenHantek6022/openhantek/src/usb/uploadFirmware.cpp:38:5: note: suggested alternative: ‘libusb_attach_kernel_driver’
libusb_set_auto_detach_kernel_driver(handle, 1);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libusb_attach_kernel_driver
[ 82%] Building CXX object openhantek/CMakeFiles/OpenHantek.dir/src/usb/usbdevice.cpp.o
[ 84%] Building CXX object openhantek/CMakeFiles/OpenHantek.dir/src/utils/printutils.cpp.o
openhantek/CMakeFiles/OpenHantek.dir/build.make:1142: recipe for target 'openhantek/CMakeFiles/OpenHantek.dir/src/usb/uploadFirmware.cpp.o' failed
make[2]: *** [openhantek/CMakeFiles/OpenHantek.dir/src/usb/uploadFirmware.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/home/intellolabs/OpenHantek6022/openhantek/src/usb/usbdevice.cpp: In static member function ‘static UniqueUSBid USBDevice::computeUSBdeviceID(libusb_device*)’:
/home/intellolabs/OpenHantek6022/openhantek/src/usb/usbdevice.cpp:51:5: *error: ‘libusb_get_port_numbers’ was not declared in this scope
libusb_get_port_numbers(device, (uint8_t )&v, sizeof(v));

^~~~~~~~~~~~~~~~~~~~~~~
/home/intellolabs/OpenHantek6022/openhantek/src/usb/usbdevice.cpp:51:5: note: suggested alternative: ‘libusb_get_bus_number’
libusb_get_port_numbers(device, (uint8_t *)&v, sizeof(v));
^~~~~~~~~~~~~~~~~~~~~~~
libusb_get_bus_number
openhantek/CMakeFiles/OpenHantek.dir/build.make:1166: recipe for target 'openhantek/CMakeFiles/OpenHantek.dir/src/usb/usbdevice.cpp.o' failed
make[2]: *** [openhantek/CMakeFiles/OpenHantek.dir/src/usb/usbdevice.cpp.o] Error 1
CMakeFiles/Makefile2:185: recipe for target 'openhantek/CMakeFiles/OpenHantek.dir/all' failed
make[1]: *** [openhantek/CMakeFiles/OpenHantek.dir/all] Error 2
Makefile:151: recipe for target 'all' failed
make: *** [all] Error 2

@Vascom
Copy link
Contributor

Vascom commented Jun 26, 2019

You not installed libusbx-devel?

@Ho-Ro
Copy link
Member

Ho-Ro commented Jun 26, 2019

libusb-1.0-0-dev is installed regarding this post: OpenHantek/openhantek#299
You're using ubuntu, correct?
Which version do you use?
Which architecture? (amd64 ?)
Do you have an old or local libusb install?
Please show the output of apt-cache policy libusb-1.0-0-dev
and also find /usr -name 'libusb.h'

To all who report issues with the friendly request for attention - please use the prepared bug report (or feature request) form and give as complete information as possible. This will save us a lot of questions. Thx!

image

image

image

@shreyansgandhi
Copy link
Author

OS: Ubuntu 18.04.02, 4.18.0-24-generic #25~18.04.1-Ubuntu SMP Thu Jun 20 11:13:08 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

Output 1:
libusb-1.0-0-dev:
Installed: 2:1.0.21-2
Candidate: 2:1.0.21-2
Version table:
*** 2:1.0.21-2 500
500 http://in.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
100 /var/lib/dpkg/status

Output 2:
/usr/include/libusb-1.0/libusb.h
/usr/local/include/libusb-1.0/libusb.h

Thank you for the support.

@Ho-Ro
Copy link
Member

Ho-Ro commented Jun 27, 2019

It's as I suspected you have a (probably older) libusb installation in /usr/local which is used instead of the correct official version. This happens when you build or install software without using the correct installer of your distribution. (As a quick'n'dirty solution for installing own sw I use checkinstall, it's available from system repo).
Please clean up your build environment - I will close this issue because it's not caused by OpenHantek6022.

EDIT: libusb_set_auto_detach_kernel_driver as well as libusb_get_port_numbers were introduced with libusb v1.0.16 in 2013, so your conflicting local install must be even older.

@Ho-Ro Ho-Ro closed this as completed Jun 27, 2019
@Ho-Ro Ho-Ro added the No issue This is not an issue label Apr 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
No issue This is not an issue
Projects
None yet
Development

No branches or pull requests

3 participants