On Sun, 13 Jan 2013 20:35:03 +0800 Xiaofan Chen <[email protected]> wrote:
> On Sun, Jan 13, 2013 at 12:04 PM, Matthias Janke > <[email protected]> wrote: > > Hi All, > > > > I've appended a patch that changes the include from libusb.h to > > libusb-1.0/libusb.h so that one hasn't to manually append > > -I/usr/include/libusb-1.0 to cmdline or makefile for projects that > > only use libftdi. Any thoughts? > > I myself am not against this patch. But the official stand of the > libusb.org maintainer (Peter Stuge) is against using this method, > rather he suggests using pkg-config to avoid manually specifying > libusb-1.0 header file directory. Hm the pkg-config call is even longer as the -I option. Plus it forks. :( pkg-config libusb-1.0 --cflags -I/usr/include/libusb-1.0 Beeing lazy is one motivaton for the patch. The other one is that compiling an application is differnt from linking. When you link libusb is proxied by libftdi, since libftdi is linked against libusb, so on the linker cmd line there is only -lftdi1. So you don't care about libusb/x at all. But when you compile you have to include libusb explicitly even if you don't use it in your application. This breaks abstraction layers. Cheers Matthias -- libftdi - see http://www.intra2net.com/en/developer/libftdi for details. To unsubscribe send a mail to [email protected]
