2014-10-18 91 views
0

我試圖建立USB Proxy我Beaglebone黑,但我得到這個錯誤:
error: 'libusb_hotplug_callback_handle' does not name a type爲什麼我無法在Beaglebone上編譯USB Proxy?

鑑於同樣的源代碼,我可以在我的Linux Mint的和Ubuntu的機器沒有問題,編譯,所以我猜測我的BB黑色設置中缺少某些東西,但無法弄清楚它是什麼。

編譯日誌:

> [email protected]:/home/debian/Downloads/USBProxy-master/src/build# 
> cmake .. 
> -- The C compiler identification is GNU 4.6.3 
> -- The CXX compiler identification is GNU 4.6.3 
> -- Check for working C compiler: /usr/bin/gcc 
> -- Check for working C compiler: /usr/bin/gcc -- works 
> -- Detecting C compiler ABI info 
> -- Detecting C compiler ABI info - done 
> -- Check for working CXX compiler: /usr/bin/c++ 
> -- Check for working CXX compiler: /usr/bin/c++ -- works 
> -- Detecting CXX compiler ABI info 
> -- Detecting CXX compiler ABI info - done 
> -- Looking for include file pthread.h 
> -- Looking for include file pthread.h - found 
> -- Looking for pthread_create 
> -- Looking for pthread_create - not found. 
> -- Looking for pthread_create in pthreads 
> -- Looking for pthread_create in pthreads - not found 
> -- Looking for pthread_create in pthread 
> -- Looking for pthread_create in pthread - found 
> -- Found Threads: TRUE 
> -- Found PkgConfig: /usr/bin/pkg-config (found version "0.26") 
> -- checking for module 'libusb-1.0' 
> -- found libusb-1.0, version 1.0.11 
> -- Found LIBUSB: /usr/lib/arm-linux-gnueabihf/libusb-1.0.so 
> -- Found LORCON: /usr/local/lib/liborcon2.so 
> -- Pcap include dirs set to /usr/include 
> -- Pcap library set to /usr/lib/arm-linux-gnueabihf/libpcap.so 
> -- Looking for pcap_version 
> -- Looking for pcap_version - found 
> -- Looking for pcap_open_dead 
> -- Looking for pcap_open_dead - found 
> -- Looking for pcap_freecode 
> -- Looking for pcap_freecode - found 
> -- Looking for pcap_breakloop 
> -- Looking for pcap_breakloop - found 
> -- Looking for pcap_create 
> -- Looking for pcap_create - found 
> -- Looking for pcap_datalink_name_to_val 
> -- Looking for pcap_datalink_name_to_val - found 
> -- Looking for pcap_datalink_val_to_description 
> -- Looking for pcap_datalink_val_to_description - found 
> -- Looking for pcap_datalink_val_to_name 
> -- Looking for pcap_datalink_val_to_name - found 
> -- Looking for pcap_findalldevs 
> -- Looking for pcap_findalldevs - found 
> -- Looking for pcap_free_datalinks 
> -- Looking for pcap_free_datalinks - found 
> -- Looking for pcap_get_selectable_fd 
> -- Looking for pcap_get_selectable_fd - found 
> -- Looking for pcap_lib_version 
> -- Looking for pcap_lib_version - found 
> -- Looking for pcap_list_datalinks 
> -- Looking for pcap_list_datalinks - found 
> -- Looking for pcap_set_datalink 
> -- Looking for pcap_set_datalink - found 
> -- Looking for pcap_open 
> -- Looking for pcap_open - not found 
> -- Looking for pcap_findalldevs_ex 
> -- Looking for pcap_findalldevs_ex - not found 
> -- Looking for pcap_createsrcstr 
> -- Looking for pcap_createsrcstr - not found 
> -- Found PCAP: /usr/include 
> -- Configuring done 
> -- Generating done 
> -- Build files have been written to: /home/debian/Downloads/USBProxy-master/src/build 
> [email protected]:/home/debian/Downloads/USBProxy-master/src/build# make 
> Scanning dependencies of target USBProxy [ 2%] Building CXX object 
> lib/CMakeFiles/USBProxy.dir/ConfigParser.cpp.o [ 5%] Building CXX 
> object lib/CMakeFiles/USBProxy.dir/Criteria.cpp.o [ 7%] Building CXX 
> object lib/CMakeFiles/USBProxy.dir/DeviceQualifier.cpp.o [ 10%] 
> Building CXX object lib/CMakeFiles/USBProxy.dir/HexString.cpp.o [ 12%] 
> Building CXX object lib/CMakeFiles/USBProxy.dir/Interface.cpp.o [ 15%] 
> Building CXX object lib/CMakeFiles/USBProxy.dir/Manager.cpp.o [ 17%] 
> Building CXX object lib/CMakeFiles/USBProxy.dir/RelayReader.cpp.o [ 
> 20%] Building CXX object lib/CMakeFiles/USBProxy.dir/TCP_Helper.cpp.o 
> [ 22%] Building CXX object 
> lib/CMakeFiles/USBProxy.dir/Configuration.cpp.o [ 25%] Building CXX 
> object lib/CMakeFiles/USBProxy.dir/Device.cpp.o [ 27%] Building CXX 
> object lib/CMakeFiles/USBProxy.dir/Endpoint.cpp.o [ 30%] Building CXX 
> object lib/CMakeFiles/USBProxy.dir/HID.cpp.o [ 32%] Building CXX 
> object lib/CMakeFiles/USBProxy.dir/InterfaceGroup.cpp.o [ 35%] 
> Building CXX object lib/CMakeFiles/USBProxy.dir/Injector.cpp.o [ 37%] 
> Building CXX object lib/CMakeFiles/USBProxy.dir/PacketFilter.cpp.o [ 
> 40%] Building CXX object 
> lib/CMakeFiles/USBProxy.dir/PluginManager.cpp.o [ 42%] Building CXX 
> object lib/CMakeFiles/USBProxy.dir/RelayWriter.cpp.o [ 45%] Building 
> CXX object lib/CMakeFiles/USBProxy.dir/USBString.cpp.o [ 47%] Building 
> C object lib/CMakeFiles/USBProxy.dir/FDInfo.c.o [ 50%] Building C 
> object lib/CMakeFiles/USBProxy.dir/get_tid.c.o [ 52%] Building C 
> object lib/CMakeFiles/USBProxy.dir/HaltSignal.c.o [ 55%] Building C 
> object lib/CMakeFiles/USBProxy.dir/mqueue_helpers.c.o Linking CXX 
> shared library libUSBProxy.so [ 55%] Built target USBProxy Scanning 
> dependencies of target DeviceProxy_LibUSB [ 57%] Building CXX object 
> Plugins/Devices/CMakeFiles/DeviceProxy_LibUSB.dir/DeviceProxy_LibUSB.cpp.o 
> In file included from 
> /home/debian/Downloads/USBProxy-master/src/Plugins/Devices/DeviceProxy_LibUSB.cpp:28:0: 
> /home/debian/Downloads/USBProxy-master/src/Plugins/Devices/DeviceProxy_LibUSB.h:38:2: 
> error: 'libusb_hotplug_callback_handle' does not name a type 
> /home/debian/Downloads/USBProxy-master/src/Plugins/Devices/DeviceProxy_LibUSB.cpp:40:79: 
> error: 'libusb_hotplug_event' has not been declared 
> /home/debian/Downloads/USBProxy-master/src/Plugins/Devices/DeviceProxy_LibUSB.cpp: 
> In constructor 'DeviceProxy_LibUSB::DeviceProxy_LibUSB(int, int, 
> bool)': 
> /home/debian/Downloads/USBProxy-master/src/Plugins/Devices/DeviceProxy_LibUSB.cpp:65:2: 
> error: 'callback_handle' was not declared in this scope 
> /home/debian/Downloads/USBProxy-master/src/Plugins/Devices/DeviceProxy_LibUSB.cpp: 
> In constructor 
> 'DeviceProxy_LibUSB::DeviceProxy_LibUSB(ConfigParser*)': 
> /home/debian/Downloads/USBProxy-master/src/Plugins/Devices/DeviceProxy_LibUSB.cpp:99:2: 
> error: 'callback_handle' was not declared in this scope 
> /home/debian/Downloads/USBProxy-master/src/Plugins/Devices/DeviceProxy_LibUSB.cpp: 
> In destructor 'virtual DeviceProxy_LibUSB::~DeviceProxy_LibUSB()': 
> /home/debian/Downloads/USBProxy-master/src/Plugins/Devices/DeviceProxy_LibUSB.cpp:111:17: 
> error: 'callback_handle' was not declared in this scope 
> /home/debian/Downloads/USBProxy-master/src/Plugins/Devices/DeviceProxy_LibUSB.cpp:112:63: 
> error: 'libusb_hotplug_deregister_callback' was not declared in this 
> scope 
> /home/debian/Downloads/USBProxy-master/src/Plugins/Devices/DeviceProxy_LibUSB.cpp: 
> In member function 'int DeviceProxy_LibUSB::connect(int, int, bool)': 
> /home/debian/Downloads/USBProxy-master/src/Plugins/Devices/DeviceProxy_LibUSB.cpp:205:56: 
> error: 'libusb_set_auto_detach_kernel_driver' was not declared in this 
> scope 
> /home/debian/Downloads/USBProxy-master/src/Plugins/Devices/DeviceProxy_LibUSB.cpp:228:7: 
> error: 'callback_handle' was not declared in this scope 
> /home/debian/Downloads/USBProxy-master/src/Plugins/Devices/DeviceProxy_LibUSB.cpp:230:51: 
> error: 'LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED' was not declared in this 
> scope 
> /home/debian/Downloads/USBProxy-master/src/Plugins/Devices/DeviceProxy_LibUSB.cpp:230:89: 
> error: 'libusb_hotplug_flag' was not declared in this scope 
> /home/debian/Downloads/USBProxy-master/src/Plugins/Devices/DeviceProxy_LibUSB.cpp:230:209: 
> error: 'libusb_hotplug_register_callback' was not declared in this 
> scope 
> /home/debian/Downloads/USBProxy-master/src/Plugins/Devices/DeviceProxy_LibUSB.cpp: 
> In member function 'virtual void DeviceProxy_LibUSB::disconnect()': 
> /home/debian/Downloads/USBProxy-master/src/Plugins/Devices/DeviceProxy_LibUSB.cpp:246:17: 
> error: 'callback_handle' was not declared in this scope 
> /home/debian/Downloads/USBProxy-master/src/Plugins/Devices/DeviceProxy_LibUSB.cpp:247:63: 
> error: 'libusb_hotplug_deregister_callback' was not declared in this 
> scope 
> /home/debian/Downloads/USBProxy-master/src/Plugins/Devices/DeviceProxy_LibUSB.cpp:249:2: 
> error: 'callback_handle' was not declared in this scope make[2]: *** 
> [Plugins/Devices/CMakeFiles/DeviceProxy_LibUSB.dir/DeviceProxy_LibUSB.cpp.o] 
> Error 1 make[1]: *** 
> [Plugins/Devices/CMakeFiles/DeviceProxy_LibUSB.dir/all] Error 2 make: 
> *** [all] Error 2 

回答

0

你需要的libusb的新版本。我有完全相同的錯誤 - 從源代碼編譯最新版本的libusb,並解決了這個問題。