LIBUSB Library Use (Quick Start)

Source: Internet
Author: User
Tags git clone

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









Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.