我需要编译dfu-programmer(我需要添加16u2支持,这是Arduino基础)。我从http://sourceforge.net/projects/dfu-programmer/files/dfu-programmer/下载了最新代码。我已经下载了0.5.4版,我运行了./bootstrap.sh ./configure,没有任何错误。现在,当我运行Make时,我收到以下错误。
cc -Wall -g -O2 -I/usr/include/libusb-1.0 -lusb-1.0 -o dfu-programmer main.o arguments.o atmel.o commands.o dfu.o intel_hex.o util.o
main.o: In function `main':
/home/tholum/Downloads/dfu-programmer-0.5.4/src/main.c:58: undefined reference to `libusb_init'
/home/tholum/Downloads/dfu-programmer-0.5.4/src/main.c:108: undefined reference to `libusb_release_interface'
/home/tholum/Downloads/dfu-programmer-0.5.4/src/main.c:121: undefined reference to `libusb_close'
/home/tholum/Downloads/dfu-programmer-0.5.4/src/main.c:131: undefined reference to `libusb_exit'
/home/tholum/Downloads/dfu-programmer-0.5.4/src/main.c:79: undefined reference to `libusb_set_debug'
dfu.o: In function `dfu_transfer_out':
/home/tholum/Downloads/dfu-programmer-0.5.4/src/dfu.c:836: undefined reference to `libusb_control_transfer'
/home/tholum/Downloads/dfu-programmer-0.5.4/src/dfu.c:836: undefined reference to `libusb_control_transfer'
dfu.o: In function `dfu_transfer_in':
/home/tholum/Downloads/dfu-programmer-0.5.4/src/dfu.c:863: undefined reference to `libusb_control_transfer'
/home/tholum/Downloads/dfu-programmer-0.5.4/src/dfu.c:863: undefined reference to `libusb_control_transfer'
dfu.o: In function `dfu_transfer_out':
/home/tholum/Downloads/dfu-programmer-0.5.4/src/dfu.c:836: undefined reference to `libusb_control_transfer'
dfu.o:/home/tholum/Downloads/dfu-programmer-0.5.4/src/dfu.c:863: more undefined references to `libusb_control_transfer' follow
dfu.o: In function `dfu_device_init':
/home/tholum/Downloads/dfu-programmer-0.5.4/src/dfu.c:388: undefined reference to `libusb_get_device_list'
/home/tholum/Downloads/dfu-programmer-0.5.4/src/dfu.c:394: undefined reference to `libusb_get_device_descriptor'
dfu.o: In function `dfu_find_interface':
/home/tholum/Downloads/dfu-programmer-0.5.4/src/dfu.c:677: undefined reference to `libusb_get_config_descriptor'
dfu.o: In function `dfu_device_init':
/home/tholum/Downloads/dfu-programmer-0.5.4/src/dfu.c:415: undefined reference to `libusb_open'
/home/tholum/Downloads/dfu-programmer-0.5.4/src/dfu.c:417: undefined reference to `libusb_set_configuration'
/home/tholum/Downloads/dfu-programmer-0.5.4/src/dfu.c:445: undefined reference to `libusb_close'
/home/tholum/Downloads/dfu-programmer-0.5.4/src/dfu.c:451: undefined reference to `libusb_free_device_list'
dfu.o: In function `dfu_find_interface':
/home/tholum/Downloads/dfu-programmer-0.5.4/src/dfu.c:716: undefined reference to `libusb_free_config_descriptor'
dfu.o: In function `dfu_device_init':
/home/tholum/Downloads/dfu-programmer-0.5.4/src/dfu.c:419: undefined reference to `libusb_claim_interface'
/home/tholum/Downloads/dfu-programmer-0.5.4/src/dfu.c:436: undefined reference to `libusb_release_interface'
/home/tholum/Downloads/dfu-programmer-0.5.4/src/dfu.c:426: undefined reference to `libusb_free_device_list'
dfu.o: In function `dfu_make_idle':
/home/tholum/Downloads/dfu-programmer-0.5.4/src/dfu.c:814: undefined reference to `libusb_reset_device'
dfu.o: In function `dfu_device_init':
/home/tholum/Downloads/dfu-programmer-0.5.4/src/dfu.c:431: undefined reference to `libusb_free_device_list'
collect2: error: ld returned 1 exit status
make: *** [dfu-programmer] Error 1
我安装了libusb-1.0-0-dev。我该如何解决这个问题?
gcc -v
的结果:
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-linux-gnu/4.7/lto-wrapper
Target: i686-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.7.2-2ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.7/README.Bugs --enable-languages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.7 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.7 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu
Thread model: posix
gcc version 4.7.2 (Ubuntu/Linaro 4.7.2-2ubuntu1)
uname -a
的结果:
Linux timsdesktop 3.5.0-19-generic #30-Ubuntu SMP Tue Nov 13 17:49:53 UTC 2012 i686 i686 i686 GNU/Linux
make -v
的结果:
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
此程序专为i686-pc-linux-gnu
而构建