Closed cjameshuff closed 12 years ago
My OS is Linux Mint 13 Maya, my toolchain is Linaro GCC 4.6-2011.10 installed using the summon-arm-toolchain script. The following was the output of make:
Blackbox:lm4tools/% make gcc -Wall -g -O2 -I/usr/include/libusb-1.0 -lusb-1.0 -o lm4flash lm4flash.c /tmp/ccODJD0f.o: In function
wait_response':
/embedded/lm4tools/lm4flash.c:123: undefined reference to libusb_bulk_transfer' /tmp/ccODJD0f.o: In function
send_command':
/embedded/lm4tools/lm4flash.c:108: undefined reference to libusb_bulk_transfer' /tmp/ccODJD0f.o: In function
main':
/embedded/lm4tools/lm4flash.c:404: undefined reference to libusb_init' /embedded/lm4tools/lm4flash.c:437: undefined reference to
libusb_exit'
/embedded/lm4tools/lm4flash.c:410: undefined reference to libusb_open_device_with_vid_pid' /embedded/lm4tools/lm4flash.c:416: undefined reference to
libusb_claim_interface'
/embedded/lm4tools/lm4flash.c:435: undefined reference to libusb_close' collect2: ld returned 1 exit status make: *** [lm4flash] Error 1
Thanks man. I also use the same toolchain as you but running on Mac OS X.
I was getting link errors...nothing referenced symbols in the libusb library at the time it was linked in, so it was ignored. The fix is simply to rearrange the order of the libraries and source code on the GCC command line.