title: LIBUSB compile error
body: <p>I am running c/c++ on Ubuntu and trying to compile the following code</p>
  
  <pre><code>#include &lt;cassert&gt;
  #include &lt;cstdio&gt;
  #include &lt;libusb-1.0/libusb.h&gt;
  
  int main() {
      libusb_context *context = NULL;
      libusb_device **list = NULL;
      int rc = 0;
      ssize_t count = 0;
  
      rc = libusb_init(&amp;context);
      assert(rc == 0);
  
      count = libusb_get_device_list(context, &amp;list);
      assert(count &gt; 0);
  
      for (size_t idx = 0; idx &lt; count; ++idx) {
          libusb_device *device = list[idx];
          libusb_device_descriptor desc = {0};
  
          rc = libusb_get_device_descriptor(device, &amp;desc);
          assert(rc == 0);
  
          printf("Vendor:Device = %04x:%04x\n", desc.idVendor, desc.idProduct);
      }
  }
  </code></pre>
  
  <p>I get the following error when after I compile my code. Don’t have any idea what should I do?</p>
  
  <pre><code>/tmp/ccESLZ0k.o: In function `main':
  libusbtest.cpp:(.text+0x2f): undefined reference to `libusb_init'
  libusbtest.cpp:(.text+0x64): undefined reference to `libusb_get_device_list'
  libusbtest.cpp:(.text+0xd4): undefined reference to `libusb_get_device_descriptor'
  collect2: ld returned 1 exit status
  </code></pre>
  
  <p>I am a novice user of Ubuntu, c/c++ and libusb, so any help would be appreciated</p>
  
  <p>Thanks</p>