Libusb undefined reference to
By : user3413957
Date : March 29 2020, 07:55 AM
help you fix your problem you have to set the library linker flag for compilation in the linker, you can get a full list in the console by executing code :
pkg-config --list-all
pkg-config --libs libusb
-lusb
-lusb-1.0
g++ myfile.cpp -lusb[-1.0]
Project -> Properties -> C/C++
Build -> Miscellaneous -> flags
|
Undefined method all_input_usages using libusb
By : Sandeep Kshirsagar
Date : March 29 2020, 07:55 AM
|
How to solve the 'undefined reference to libusb' error in ros?
By : user2790602
Date : March 29 2020, 07:55 AM
I wish this help you find_package requires that CMake have a corresponding Find .cmake Cmake have a pkg-config module. code :
find_package(PkgConfig REQUIRED)
pkg_search_module(LIBUSB1 REQUIRED libusb-1.0)
include_directories(SYSTEM ${LIBUSB1_INCLUDE_DIRS})
|
Undefined reference to libusb functions
By : AzOoDev
Date : March 29 2020, 07:55 AM
I wish did fix the issue. After discussion with an engineer from the vendor that provided the software, it was determined that I was using a newer version of Ubuntu (v16) then they had developed the software on. When I compiled on the older version (v14), it compiled just fine. The engineer wasn't able to explain what changed in Ubuntu 16 that broke their code, but this solved the problem for me for now.
|
libusb: error [submit_bulk_transfer] submiturb failed error -1 errno=2 - What am I doing wrong with LibUSB?
By : Kristian von Riechst
Date : March 29 2020, 07:55 AM
I hope this helps you . Ok, so I figured out the issue. Basically, apparently, for ~reasons~, the endpoints for my device are attached to configuration 0, alternate setting 1. code :
1 pi@testpi:~/BatLogger/Interface/libusb_test$ sudo python3 test.py
INFO:Main.Gui:Device: DEVICE ID 03eb:2423 on Bus 001 Address 004 =================
bLength : 0x12 (18 bytes)
bDescriptorType : 0x1 Device
bcdUSB : 0x200 USB 2.0
bDeviceClass : 0x0 Specified at interface
bDeviceSubClass : 0x0
bDeviceProtocol : 0x0
bMaxPacketSize0 : 0x40 (64 bytes)
idVendor : 0x03eb
idProduct : 0x2423
bcdDevice : 0x100 Device 1.0
iManufacturer : 0x1 ATMEL ASF
iProduct : 0x2 Vendor Class Example
iSerialNumber : 0x0
bNumConfigurations : 0x1
CONFIGURATION 1: 100 mA ==================================
bLength : 0x9 (9 bytes)
bDescriptorType : 0x2 Configuration
wTotalLength : 0x45 (69 bytes)
bNumInterfaces : 0x1
bConfigurationValue : 0x1
iConfiguration : 0x0
bmAttributes : 0xc0 Self Powered
bMaxPower : 0x32 (100 mA)
INTERFACE 0: Vendor Specific ===========================
bLength : 0x9 (9 bytes)
bDescriptorType : 0x4 Interface
bInterfaceNumber : 0x0
bAlternateSetting : 0x0
bNumEndpoints : 0x0
bInterfaceClass : 0xff Vendor Specific
bInterfaceSubClass : 0xff
bInterfaceProtocol : 0xff
iInterface : 0x0
INTERFACE 0, 1: Vendor Specific ========================
bLength : 0x9 (9 bytes)
bDescriptorType : 0x4 Interface
bInterfaceNumber : 0x0
bAlternateSetting : 0x1
bNumEndpoints : 0x6
bInterfaceClass : 0xff Vendor Specific
bInterfaceSubClass : 0xff
bInterfaceProtocol : 0xff
iInterface : 0x0
ENDPOINT 0x81: Interrupt IN ==========================
bLength : 0x7 (7 bytes)
bDescriptorType : 0x5 Endpoint
bEndpointAddress : 0x81 IN
bmAttributes : 0x3 Interrupt
wMaxPacketSize : 0x40 (64 bytes)
bInterval : 0x1
ENDPOINT 0x2: Interrupt OUT ==========================
bLength : 0x7 (7 bytes)
bDescriptorType : 0x5 Endpoint
bEndpointAddress : 0x2 OUT
bmAttributes : 0x3 Interrupt
wMaxPacketSize : 0x40 (64 bytes)
bInterval : 0x1
ENDPOINT 0x83: Bulk IN ===============================
bLength : 0x7 (7 bytes)
bDescriptorType : 0x5 Endpoint
bEndpointAddress : 0x83 IN
bmAttributes : 0x2 Bulk
wMaxPacketSize : 0x40 (64 bytes)
bInterval : 0x0
ENDPOINT 0x4: Bulk OUT ===============================
bLength : 0x7 (7 bytes)
bDescriptorType : 0x5 Endpoint
bEndpointAddress : 0x4 OUT
bmAttributes : 0x2 Bulk
wMaxPacketSize : 0x40 (64 bytes)
bInterval : 0x0
ENDPOINT 0x85: Isochronous IN ========================
bLength : 0x7 (7 bytes)
bDescriptorType : 0x5 Endpoint
bEndpointAddress : 0x85 IN
bmAttributes : 0x1 Isochronous
wMaxPacketSize : 0x100 (256 bytes)
bInterval : 0x1
ENDPOINT 0x6: Isochronous OUT ========================
bLength : 0x7 (7 bytes)
bDescriptorType : 0x5 Endpoint
bEndpointAddress : 0x6 OUT
bmAttributes : 0x1 Isochronous
wMaxPacketSize : 0x100 (256 bytes)
bInterval : 0x1
rc = libusb_set_interface_alt_setting(dev_handle, DEVICE_CONFIGURATION, 1);
if(rc != 0) {
std::cout << "Cannot configure alternate setting" << std::endl;
return 3;
}
|