title: ImportError: DLL load failed with pybind11 and PCL
body: <p>I'm using pybind11 to create a Python wrapper for a small C++ class.<br>
  I'm getting the following error when importing the DLL (running <code>python -v</code> to show Traceback):</p>
  
  <pre><code>&gt;&gt;&gt; from a_py import *
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "&lt;frozen importlib._bootstrap&gt;", line 991, in _find_and_load
    File "&lt;frozen importlib._bootstrap&gt;", line 975, in _find_and_load_unlocked
    File "&lt;frozen importlib._bootstrap&gt;", line 657, in _load_unlocked
    File "&lt;frozen importlib._bootstrap&gt;", line 556, in module_from_spec
    File "&lt;frozen importlib._bootstrap_external&gt;", line 1101, in create_module
    File "&lt;frozen importlib._bootstrap&gt;", line 219, in _call_with_frames_removed
  ImportError: DLL load failed while importing a_py: The specified module could not be found.
  </code></pre>
  
  <p>The class has just two members - types from the PCL library:</p>
  
  <pre><code>class A
  {
     pcl::NormalEstimation&lt; pcl::PointXYZ, pcl::Normal&gt; normalEstimation_;
     pcl::PointCloud&lt;pcl::Normal&gt;::Ptr normals_;
  };
  </code></pre>
  
  <p>If I remove the <em>first</em> member I can successfully import the module from the DLL. </p>
  
  <p>This is the pybind11 code:</p>
  
  <pre><code>namespace py = pybind11;
  
  PYBIND11_MODULE(a_py, m)
  {
     py::class_&lt;A&gt;(m, "A");
  }
  </code></pre>
  
  <p>PCL is found using CMake: <code>find_package(PCL REQUIRED)</code></p>
  
  <p>This happens on both Windows and Linux with the latest PCL (1.10) and older versions too.</p>
  
  <p>(Adding <code>#define PCL_NO_PRECOMPILE</code> before the #includes does not help.)</p>
  
  <p><strong>Update:</strong>
  I opened <a href="https://github.com/PointCloudLibrary/pcl/issues/3963" rel="nofollow noreferrer">a GitHUb issue</a> about this, since this seems like a spurious internal runtime dependency.</p>