utzig / lm4tools

Tools to enable multi-platform development on the TI Stellaris Launchpad boards
203 stars 46 forks source link

Link errors #1

Closed cjameshuff closed 12 years ago

cjameshuff commented 12 years ago

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.

cjameshuff commented 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 functionwait_response': /embedded/lm4tools/lm4flash.c:123: undefined reference to libusb_bulk_transfer' /tmp/ccODJD0f.o: In functionsend_command': /embedded/lm4tools/lm4flash.c:108: undefined reference to libusb_bulk_transfer' /tmp/ccODJD0f.o: In functionmain': /embedded/lm4tools/lm4flash.c:404: undefined reference to libusb_init' /embedded/lm4tools/lm4flash.c:437: undefined reference tolibusb_exit' /embedded/lm4tools/lm4flash.c:410: undefined reference to libusb_open_device_with_vid_pid' /embedded/lm4tools/lm4flash.c:416: undefined reference tolibusb_claim_interface' /embedded/lm4tools/lm4flash.c:435: undefined reference to libusb_close' collect2: ld returned 1 exit status make: *** [lm4flash] Error 1

utzig commented 12 years ago

Thanks man. I also use the same toolchain as you but running on Mac OS X.