Please indicate the source: Sea Vortex
http://blog.csdn.net/tanhuifang520
First, download Libusb source
(1) Download under ubuntu command
sudo git clone https://github.com/libusb/libusb.git
(2) Download on GitHub
Https://github.com/libusb/libusb
Second, the configuration
./configure--build=i686-linux--host=arm-linux--prefix=/home/xfc/usb/install cc=/mnt/codesourcery/sourcery_ CODEBENCH_LITE_FOR_XILINX_GNU_LINUX/BIN/ARM-XILINX-LINUX-GNUEABI-GCC Cxx=/mnt/codesourcery/sourcery_codebench_ lite_for_xilinx_gnu_linux/bin/arm-xilinx-linux-gnueabi-g++
The following error is reported after the execution of the above instructions
Configure:error: "Udev support requested but libudev not installed"
Workaround: Add--disable-udev after the above compilation command
After make install, we can see the compiled library and the corresponding header file in the directory specified by prefix. The name of the library file used under the ARM platform is: libusb-1.0.so.0.1.0.
–build=i686-linux says the software is compiled on the x86 platform
–host=arm-linux indicates that the software has been compiled and run on the arm platform
–prefix is followed by the Software installation directory.
Cc=,cxx equals the c,c++ cross compiler that specifies the cross compilation
Third, compiling
Make&&make Install
Iv. use of the compiler program
You need to copy the previously precompiled Dynamic library to the/lib folder under Zynq Linux. Note that the copied library file name is: libusb-1.0.so.0.1.0. After copying to/lib, you need to rename to libusb-1.0.so.0.
Libusb=/home/xfc/usb/install
Arm-xilinx-linux-gnueabi-gcc-o test-i${libusb}/include/libusb-1.0-l${libusb}/lib/-lusb-1.0 test.c