Wed 20 Oct 2010 02:07:13 PM UTC, original submission:
Tested with revision 947 (as at 21 October 2010).
Attempts to build fail with:
...
gcc -Wall -g -O2 -o avrdude avrdude-main.o avrdude-term.o ./libavrdude.a -lusb -framework CoreFoundation -framework IOKit -lm -lreadline -lncurses -ltermcap
Undefined symbols:
"_libusb_get_device_list", referenced from:
_usbOpenDevice in libavrdude.a(libavrdude_a-usbasp.o)
"_libusb_control_transfer", referenced from:
_usbasp_transmit in libavrdude.a(libavrdude_a-usbasp.o)
"_libusb_close", referenced from:
_usbOpenDevice in libavrdude.a(libavrdude_a-usbasp.o)
_usbasp_close in libavrdude.a(libavrdude_a-usbasp.o)
"_libusb_get_device_descriptor", referenced from:
_usbOpenDevice in libavrdude.a(libavrdude_a-usbasp.o)
"_libusb_init", referenced from:
_usbOpenDevice in libavrdude.a(libavrdude_a-usbasp.o)
_usbasp_open in libavrdude.a(libavrdude_a-usbasp.o)
"_libusb_get_string_descriptor_ascii", referenced from:
_usbOpenDevice in libavrdude.a(libavrdude_a-usbasp.o)
_usbOpenDevice in libavrdude.a(libavrdude_a-usbasp.o)
"_libusb_open", referenced from:
_usbOpenDevice in libavrdude.a(libavrdude_a-usbasp.o)
ld: symbol(s) not found
...
This is on a Mac OS X 10.5 Intel system that has the following libraries:
/usr/local/lib/libusb-0.1.4.4.4.dylib
/usr/local/lib/libusb-0.1.4.4.5.dylib
/usr/local/lib/libusb-0.1.4.dylib
/usr/local/lib/libusb-1.0.0.dylib
/usr/local/lib/libusb-1.0.dylib
/usr/local/lib/libusb.dylib
Replacing "-lusb" with "-lusb-1.0" results in another different set of "Undefined symbols" errors.
Revision 940 compiles successfully, revision 941 introduces the failure.
Two different workarounds made the compile successful:
* Include both "-lusb" and "-lusb-1.0" in the compiler call.
* Modify usbasp.c to only define "USE_LIBUSB_1_0" if HAVE_LIBUSB is not defined. This forces use of libusb-0.1 even if libusb1.0 is installed. e.g. :
#if !defined(HAVE_LIBUSB)
#ifdef HAVE_LIBUSB_1_0
# define USE_LIBUSB_1_0
#endif
#endif
I haven't tested either of these modifications on any other system.
|