title: libudev development package not found
body: <p>I am writing an app autodetect devices is plugged/unplugged.</p>
  
  <p>I used C++ with the Qt framework. <strong><em>libudev.h</em></strong> was included on my code.
  and I actually installed libudev-dev package successful via <code>sudo apt-get install libudev-dev</code> but QtCreator still has an error message: <code>libudev development package not found</code></p>
  
  <p>file .pro: </p>
  
  <pre><code>...
  CONFIG   += console c++11
  CONFIG   -= app_bundle
  unix: CONFIG += link_pkgconfig
  unix: PKGCONFIG += libudev
  HEADERS += DeviceManager.h
  SOURCES += main.cpp \
    DeviceManager.cpp
  ...
  </code></pre>
  
  <p>DeviceManager.h file: </p>
  
  <pre><code>#ifndef DEVICEMANAGER_H
  #define DEVICEMANAGER_H
  
  #include &lt;QObject&gt;
  #include &lt;QDebug&gt;
  #include &lt;QSet&gt;
  #include &lt;libudev.h&gt;
  
  #include "DeviceModel.h"
  
  class DeviceManager : public QObject
  {
      Q_OBJECT
  public:
      explicit DeviceManager(QObject *parent = 0);
  
      QSet&lt;DeviceModel *&gt; getDevices();
      QStringList getDevicePaths();
  
  private:
      QSet&lt;DeviceModel *&gt; pluggedDevices;
  
  };
  #endif // DEVICEMANAGER_H
  
  </code></pre>
  
  <p>DeviceManager.cpp file: </p>
  
  <pre><code>#include "DeviceManager.h"
  
  DeviceManager::DeviceManager(QObject *parent) :
      QObject(parent)
  {
  }
  
  QSet&lt;DeviceModel *&gt; DeviceManager::getDevices()
  {
      QSet&lt;DeviceModel *&gt; devices = QSet&lt;DeviceModel *&gt;();
      struct udev *udev;
      struct udev_enumerate *enumerate;
      struct udev_list_entry *dev_list, *dev_list_entry;
      struct udev_device *dev;
      struct udev_monitor *mon;
  
      /* Create the udev object */
      udev = udev_new();
      if (!udev)
      {
          qDebug() &lt;&lt; "Can't create udev";
          return devices;
      }
  
      /* Set up a monitor to monitor hidraw devices */
      mon = udev_monitor_new_from_netlink(udev, "udev");
      udev_monitor_filter_add_match_subsystem_devtype(mon, "usb", "usb_device");
      udev_monitor_enable_receiving(mon);
  
      enumerate = udev_enumerate_new(udev);
      udev_enumerate_add_match_subsystem(enumerate, "usb");
      udev_enumerate_scan_devices(enumerate);
      dev_list = udev_enumerate_get_list_entry(enumerate);
      QString vendorID, serialNumber, devName, deviceName;
      udev_list_entry_foreach(dev_list_entry, dev_list)
      {
          const char *path;
          path = udev_list_entry_get_name(dev_list_entry);
          dev = udev_device_new_from_syspath(udev, path);
  
          udev_device_get_parent_with_subsystem_devtype(dev, "usb", "usb_device");
  
          if (!dev)
          {
              qDebug() &lt;&lt; "Unable to find parent usb device.";
              return devices;
          }
          vendorID = udev_device_get_property_value(dev, "ID_VENDOR_ID");
          devName = udev_device_get_property_value(dev, "DEVNAME");
          if (!vendorID.isNull() &amp;&amp; vendorID.compare("04e8") == 0)    // vendor ID of Samsung devices
          {
                  DeviceModel *device = new DeviceModel();
                  serialNumber = udev_device_get_property_value(dev, "ID_SERIAL_SHORT");
                  deviceName = QString(udev_device_get_property_value(dev, "DEVPATH")).split("/").last();
                  if (!serialNumber.isNull())
                  {
                      device-&gt;setDownloadMode(false);
                      device-&gt;setSerialNumber(serialNumber);
                  }
                  else if(!devName.isNull())
                  {
                      device-&gt;setPath(devName);
                      device-&gt;setDownloadMode(true);
                  }
                  else
                      break;
                  device-&gt;setName(deviceName);
                  devices.insert(device);
          }
          udev_device_unref(dev);
      }
      /* Free the enumerator object */
      udev_enumerate_unref(enumerate);
      udev_unref(udev);
      this-&gt;pluggedDevices = devices;
      return devices;
  }
  
  QStringList DeviceManager::getDevicePaths()
  {
      QStringList result;
      if (this-&gt;pluggedDevices.isEmpty())
      {
          return result;
      }
      foreach (DeviceModel *device, this-&gt;pluggedDevices)
      {
          result.append(device-&gt;getPath());
      }
      return result;
  }
  </code></pre>
  
  <p><strong>Environment:</strong></p>
  
  <p>OS: Ubuntu 18.04.2 LTS</p>
  
  <p>Qt Creator 4.5.2 Based on Qt 5.9.5 (GCC 7.3.0, 64bit)</p>
  
  <p>Could you help me find a reason?</p>