Also tested with -Wall and -std=c99 and c11 (not working of course)
Code:
$ gcc -o usb -L/usr/local/lib -lusb-1.0 -I/usr/local/include usbtest.c
Output:
Code:
usbtest.c: In function ‘main’:
usbtest.c:14:1: error: label ‘brd_ftdi’ used but not defined
libusb_get_device_list(context, &&brd_ftdi);
^
usbtest.c:
Code:
#include <stdio.h>
#include <libusb-1.0/libusb.h>
int main() {
libusb_device* brd_ftdi;
libusb_device_handle** brd_ftdi_handle;
libusb_context* context;
//libusb_device *** list = &&brd_ftdi;
//libusb_init (libusb_context **);
libusb_init (&context);
libusb_get_device_list(context, &&brd_ftdi);
//libusb_open(brd_ftdi, brd_ftdi_handle);
//libusb_exit(struct libusb_context *);
libusb_exit(context);
return 0;
}
Not defined? I know, but libusb_get_device_list() is supposed to do it (put the list in there), so WTF? I also tested declaring a pointer to pointer to brd_ftdi and passing that on instead but same result.