|
From: Ludovic R. <lud...@gm...> - 2010-08-16 15:17:48
|
Hello, In my code I used: #include <libusb-1.0/libusb.h> But this failed (see [1] and [2]) on Debian kfreebsd because kfreebsd use another implementation of libusb-1.0 API and the libusb.h file is in /usr/include/ and not in /usr/include/libusb-1.0/ (see [3]) So my code code should use: #include <libusb.h> But then I am including libusb.h from libusb-0.1 present in /usr/include/ It looks like it is not possible to specify the libusb-1.0 header file when: - libusb-0.1 is also installed - your code should be portable to kfreebsd One solution would to rename libusb-1.0/libusb.h in libusb-1.0/libusb-1.0.h and indicate the API version in the header file name (and not in the header file _path_). But that would not work on kfreebsd unless they also rename their header file to libusb-1.0.h. Since libusb.h from libusb-0.1 and libusb.h from libusb-1.0 conficts why not include libusb.h in /usr/include/ instead of /usr/include/libusb-1.0/? And: $ pkg-config --cflags libusb-1.0 -I/usr/include/libusb-1.0 So application code should only use #include <libusb.h> for libusb-1.0 (without the directory name). I looked at the sample codes in libusb/examples and they are using: #include <libusb/libusb.h> So can't be compiled (without modification) outside of libusb itself. I have no solution right now. But I have a problem. Regards, [1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=591782 [2] https://buildd.debian.org/fetch.cgi?pkg=ccid&arch=kfreebsd-i386&ver=1.4.0-1&stamp=1280932718&file=log&as=raw [3] http://packages.debian.org/sid/kfreebsd-i386/libusb2-dev/filelist -- Dr. Ludovic Rousseau |