title: Pybind11 error undefined reference to `Py_GetVersion'
body: <p>I'm trying to get Pybind 11 to work and am struggling. I tried to compile my .cpp file using this:</p>
  
  <pre><code>c++  -Wall -std=c++11 -fPIC `python3 -m --includes` -I ~/Documents/Single_electron/pybind11/include single_e.cpp -o single_e `python-config --includes`
  </code></pre>
  
  <p>But get a whole host of errors, starting with this list:</p>
  
  <pre><code> single_e.cpp :(.text+0xaa): undefined reference to `Py_GetVersion'
   single_e.cpp :(.text+0x104): undefined reference to `PyExc_ImportError'
   single_e.cpp :(.text+0x123): undefined reference to `PyErr_Format'
   single_e.cpp :(.text+0x1b2): undefined reference to `PyExc_ImportError'
   single_e.cpp :(.text+0x1c0): undefined reference to `PyErr_SetString'
   single_e.cpp :(.text+0x1f9): undefined reference to `PyExc_ImportError'
   single_e.cpp :(.text+0x207): undefined reference to `PyErr_SetString'
  </code></pre>
  
  <p>Has anyone got any suggestions about how I should fix this? </p>