title: Pybind11 Type Error
body: <p>I've recently been trying to write a function in C++ that converts a vector of doubles into a vector of strings.  I want to run this from a python interpreter so I'm using Pybind11 to interface C++ and Python.  This is what I have so far,</p>
  
  <pre><code>#include &lt;pybind11/pybind11.h&gt;
  #include &lt;boost/lexical_cast.hpp&gt;
  #include &lt;iostream&gt;
  #include &lt;iomanip&gt;
  #include &lt;algorithm&gt;
  #include &lt;vector&gt;
  
  
  std::string castToString(double v) {
      std::string str = boost::lexical_cast&lt;std::string&gt;(v);
      return str;
  }
  
  std::vector&lt;std::vector&lt;std::string&gt; &gt; num2StringVector(std::vector&lt;std::vector&lt;double&gt; &gt;&amp; inputVector) {
  
  
      //using namespace boost::multiprecision;
  
  
      std::vector&lt;std::vector&lt;std::string&gt; &gt; outputVector;
  
      std::transform(inputVector.begin(), inputVector.end(), std::back_inserter(outputVector), [](const std::vector&lt;double&gt; &amp;iv) {
          std::vector&lt;std::string&gt; dv;
          std::transform(iv.begin(), iv.end(), std::back_inserter(dv), &amp;castToString);
          return dv;
      });
  
      return outputVector;
  }
  
  
  namespace py = pybind11;
  
  PYBIND11_PLUGIN(num2String) {
      py::module m("num2String", "pybind11 example plugin");
  
      m.def("num2StringVector", &amp;num2StringVector, "this converts a vector of doubles to a vector of strings.");
      m.def("castToString", &amp;castToString, "This function casts a double to a string using Boost.");
  
      return m.ptr();
  }
  </code></pre>
  
  <p>Now this compiles into a shared library, using the follow command from command line:</p>
  
  <pre><code>c++ -O3 -shared -std=gnu++11 -I ../include `python-config --cflags --ldflags --libs` num2StringVectorPyBind.cpp -o num2String.so -fPIC -lquadmath
  </code></pre>
  
  <p>where the ../include is where the pybind11 includes are.  After compilation start up python and use,</p>
  
  <pre><code>import num2String
  values = [[10, 20], [30, 40]]
  num2String.num2StringVector(values)
  </code></pre>
  
  <p>And I get the following error, "Incompatible function arguments. The following argument types are supported".  Where it then gives me a list of possible types, this is strange because I'm just trying to use a vector as my function argument which according to the documentation for pybind11 this is a supported data type:
  <a href="http://pybind11.readthedocs.io/en/latest/basics.html#supported-data-types" rel="noreferrer">http://pybind11.readthedocs.io/en/latest/basics.html#supported-data-types</a></p>
  
  <p>Is it that I have a vector of vectors (a 2d vector) and that is unsupported? </p>