When building something probably written for Unix (I were fudging s10sh), you might eventually end up with undefined symbols such as:
gcc -O2 -Wall -g -I./libusb -o s10sh main.o crc.o usb.o serial.o common.o bar.o -lreadline -ltermcap libusb/.libs/libusb.a ld: Undefined symbols: _CFRunLoopAddSource _CFRunLoopGetCurrent _CFRunLoopRun _CFRunLoopStop _CFUUIDGetConstantUUIDWithBytes _CFUUIDGetUUIDBytes _IOCreatePlugInInterfaceForService _IOIteratorNext _IOMasterPort _IONotificationPortCreate _IONotificationPortGetRunLoopSource _IOObjectRelease _IOServiceAddMatchingNotification _IOServiceMatching _kCFRunLoopDefaultMode make: *** [s10sh] Error 1
The IOService errors can be fixed by -lIOKit thusly:
stany@gilva:~/src/s10sh-0.2.2[07:52 PM]$ gcc -O2 -Wall -g -I./libusb -o s10sh main.o crc.o usb.o serial.o common.o bar.o -lreadline -ltermcap libusb/.libs/libusb.a -lIOKit ld: Undefined symbols: _CFRunLoopAddSource _CFRunLoopGetCurrent _CFRunLoopRun _CFRunLoopStop _CFUUIDGetConstantUUIDWithBytes _CFUUIDGetUUIDBytes _kCFRunLoopDefaultMode stany@gilva:~/src/s10sh-0.2.2[07:53 PM]$
but the “proper” way to fix it is:
stany@gilva:~/src/s10sh-0.2.2[07:53 PM]$ gcc -O2 -Wall -g -I./libusb -o s10sh main.o crc.o usb.o serial.o common.o bar.o -lreadline -ltermcap libusb/.libs/libusb.a -framework IOKit -framework CoreFoundation stany@gilva:~/src/s10sh-0.2.2[07:53 PM]$
stany@gilva:~/src/s10sh-0.2.2[07:54 PM]$ ./s10sh -u USB mode enabled S10sh -- version 0.2.2 Copyright (C) 2000-2001 by Salvatore SanfilippoS10sh is FREE SOFTWARE under the terms of the GNU public license [Canon PowerShot A75] > ls ls error [Canon PowerShot A75] >
*sigh*