PyBind11 Linker Errors when compiling extension

ribofadam: <p>I am able to succesfully compile and link code that uses <code>&lt;torch/torch.h&gt;</code>, but as soon as I include a reference to PyBind11, with <code>PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) {</code>… the program fails to link with these errors. I am building with CMake, and pytorch compiled from source, on cxx 17, with g++ version 11.3</p>
<pre><code class="lang-auto">/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): warning: relocation against `PyInstanceMethod_Type' in read-only section `.text._ZN8pybind1112cpp_function18initialize_genericEOSt10unique_ptrINS_6detail15function_recordENS0_33InitializingFunctionRecordDeleterEEPKcPKPKSt9type_infom[_ZN8pybind1112cpp_function18initialize_genericEOSt10unique_ptrINS_6detail15function_recordENS0_33InitializingFunctionRecordDeleterEEPKcPKPKSt9type_infom]'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `_PyObject_TypeCheck':
font_renderer.cpp:(.text+0xdd): undefined reference to `PyType_IsSubtype'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `_Py_DECREF':
font_renderer.cpp:(.text+0x14a): undefined reference to `_Py_Dealloc'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `PyInit_TORCH_EXTENSION_NAME':
font_renderer.cpp:(.text+0xc5a): undefined reference to `Py_GetVersion'
/usr/bin/ld: font_renderer.cpp:(.text+0xcb4): undefined reference to `PyExc_ImportError'
/usr/bin/ld: font_renderer.cpp:(.text+0xcd0): undefined reference to `PyErr_Format'
/usr/bin/ld: font_renderer.cpp:(.text+0xd81): undefined reference to `PyExc_ImportError'
/usr/bin/ld: font_renderer.cpp:(.text+0xd8c): undefined reference to `PyErr_SetString'
/usr/bin/ld: font_renderer.cpp:(.text+0xdc5): undefined reference to `PyExc_ImportError'
/usr/bin/ld: font_renderer.cpp:(.text+0xdd0): undefined reference to `PyErr_SetString'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11::type_error::set_error() const':
font_renderer.cpp:(.text._ZNK8pybind1110type_error9set_errorEv[_ZNK8pybind1110type_error9set_errorEv]+0x29): undefined reference to `PyExc_TypeError'
/usr/bin/ld: font_renderer.cpp:(.text._ZNK8pybind1110type_error9set_errorEv[_ZNK8pybind1110type_error9set_errorEv]+0x34): undefined reference to `PyErr_SetString'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11::cast_error::set_error() const':
font_renderer.cpp:(.text._ZNK8pybind1110cast_error9set_errorEv[_ZNK8pybind1110cast_error9set_errorEv]+0x29): undefined reference to `PyExc_RuntimeError'
/usr/bin/ld: font_renderer.cpp:(.text._ZNK8pybind1110cast_error9set_errorEv[_ZNK8pybind1110cast_error9set_errorEv]+0x34): undefined reference to `PyErr_SetString'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11::error_scope::error_scope()':
font_renderer.cpp:(.text._ZN8pybind1111error_scopeC2Ev[_ZN8pybind1111error_scopeC5Ev]+0x27): undefined reference to `PyErr_Fetch'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11::error_scope::~error_scope()':
font_renderer.cpp:(.text._ZN8pybind1111error_scopeD2Ev[_ZN8pybind1111error_scopeD5Ev]+0x2a): undefined reference to `PyErr_Restore'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11::buffer_info::~buffer_info()':
font_renderer.cpp:(.text._ZN8pybind1111buffer_infoD2Ev[_ZN8pybind1111buffer_infoD5Ev]+0x34): undefined reference to `PyBuffer_Release'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11::error_already_set::error_already_set()':
font_renderer.cpp:(.text._ZN8pybind1117error_already_setC2Ev[_ZN8pybind1117error_already_setC5Ev]+0xc7): undefined reference to `PyErr_Fetch'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11::error_already_set::restore()':
font_renderer.cpp:(.text._ZN8pybind1117error_already_set7restoreEv[_ZN8pybind1117error_already_set7restoreEv]+0x91): undefined reference to `PyErr_Restore'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11::hasattr(pybind11::handle, char const*)':
font_renderer.cpp:(.text._ZN8pybind117hasattrENS_6handleEPKc[_ZN8pybind117hasattrENS_6handleEPKc]+0x2a): undefined reference to `PyObject_HasAttrString'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11::getattr(pybind11::handle, char const*)':
font_renderer.cpp:(.text._ZN8pybind117getattrENS_6handleEPKc[_ZN8pybind117getattrENS_6handleEPKc]+0x40): undefined reference to `PyObject_GetAttrString'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11::getattr(pybind11::handle, char const*, pybind11::handle)':
font_renderer.cpp:(.text._ZN8pybind117getattrENS_6handleEPKcS0_[_ZN8pybind117getattrENS_6handleEPKcS0_]+0x41): undefined reference to `PyObject_GetAttrString'
/usr/bin/ld: font_renderer.cpp:(.text._ZN8pybind117getattrENS_6handleEPKcS0_[_ZN8pybind117getattrENS_6handleEPKcS0_]+0x79): undefined reference to `PyErr_Clear'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11::setattr(pybind11::handle, pybind11::handle, pybind11::handle)':
font_renderer.cpp:(.text._ZN8pybind117setattrENS_6handleES0_S0_[_ZN8pybind117setattrENS_6handleES0_S0_]+0x4e): undefined reference to `PyObject_SetAttr'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11::setattr(pybind11::handle, char const*, pybind11::handle)':
font_renderer.cpp:(.text._ZN8pybind117setattrENS_6handleEPKcS0_[_ZN8pybind117setattrENS_6handleEPKcS0_]+0x43): undefined reference to `PyObject_SetAttrString'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11::detail::accessor_policies::generic_item::get(pybind11::handle, pybind11::handle)':
font_renderer.cpp:(.text._ZN8pybind116detail17accessor_policies12generic_item3getENS_6handleES3_[_ZN8pybind116detail17accessor_policies12generic_item3getENS_6handleES3_]+0x4b): undefined reference to `PyObject_GetItem'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11::detail::accessor_policies::generic_item::set(pybind11::handle, pybind11::handle, pybind11::handle)':
font_renderer.cpp:(.text._ZN8pybind116detail17accessor_policies12generic_item3setENS_6handleES3_S3_[_ZN8pybind116detail17accessor_policies12generic_item3setENS_6handleES3_S3_]+0x4e): undefined reference to `PyObject_SetItem'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11::detail::accessor_policies::list_item::get(pybind11::handle, unsigned long)':
font_renderer.cpp:(.text._ZN8pybind116detail17accessor_policies9list_item3getENS_6handleEm[_ZN8pybind116detail17accessor_policies9list_item3getENS_6handleEm]+0x40): undefined reference to `PyList_GetItem'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11::detail::accessor_policies::tuple_item::get(pybind11::handle, unsigned long)':
font_renderer.cpp:(.text._ZN8pybind116detail17accessor_policies10tuple_item3getENS_6handleEm[_ZN8pybind116detail17accessor_policies10tuple_item3getENS_6handleEm]+0x40): undefined reference to `PyTuple_GetItem'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11::detail::accessor_policies::tuple_item::set(pybind11::handle, unsigned long, pybind11::handle)':
font_renderer.cpp:(.text._ZN8pybind116detail17accessor_policies10tuple_item3setENS_6handleEmS3_[_ZN8pybind116detail17accessor_policies10tuple_item3setENS_6handleEmS3_]+0x4b): undefined reference to `PyTuple_SetItem'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11::detail::iterator_policies::dict_readonly::increment()':
font_renderer.cpp:(.text._ZN8pybind116detail17iterator_policies13dict_readonly9incrementEv[_ZN8pybind116detail17iterator_policies13dict_readonly9incrementEv]+0x45): undefined reference to `PyDict_Next'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11::str::str(char const*)':
font_renderer.cpp:(.text._ZN8pybind113strC2EPKc[_ZN8pybind113strC5EPKc]+0x2c): undefined reference to `PyUnicode_FromString'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11::str::operator std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;() const':
font_renderer.cpp:(.text._ZNK8pybind113strcvNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEv[_ZNK8pybind113strcvNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEv]+0x5f): undefined reference to `PyUnicode_AsUTF8String'
/usr/bin/ld: font_renderer.cpp:(.text._ZNK8pybind113strcvNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEv[_ZNK8pybind113strcvNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEv]+0xe7): undefined reference to `PyBytes_AsStringAndSize'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11::str::raw_str(_object*)':
font_renderer.cpp:(.text._ZN8pybind113str7raw_strEP7_object[_ZN8pybind113str7raw_strEP7_object]+0x14): undefined reference to `PyObject_Str'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11::none::none()':
font_renderer.cpp:(.text._ZN8pybind114noneC2Ev[_ZN8pybind114noneC5Ev]+0x27): undefined reference to `_Py_NoneStruct'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11::weakref::weakref(pybind11::handle, pybind11::handle)':
font_renderer.cpp:(.text._ZN8pybind117weakrefC2ENS_6handleES1_[_ZN8pybind117weakrefC5ENS_6handleES1_]+0x4f): undefined reference to `PyWeakref_NewRef'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11::capsule::check_(pybind11::handle)':
font_renderer.cpp:(.text._ZN8pybind117capsule6check_ENS_6handleE[_ZN8pybind117capsule6check_ENS_6handleE]+0x32): undefined reference to `PyCapsule_Type'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11::capsule::capsule(void const*, char const*, void (*)(_object*))':
font_renderer.cpp:(.text._ZN8pybind117capsuleC2EPKvPKcPFvP7_objectE[_ZN8pybind117capsuleC5EPKvPKcPFvP7_objectE]+0x3f): undefined reference to `PyCapsule_New'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11::capsule::capsule(void const*, void (*)(void*))::{lambda(_object*)#1}::operator()(_object*) const':
font_renderer.cpp:(.text._ZZN8pybind117capsuleC4EPKvPFvPvEENKUlP7_objectE_clES7_[_ZZN8pybind117capsuleC4EPKvPFvPvEENKUlP7_objectE_clES7_]+0x18): undefined reference to `PyCapsule_GetContext'
/usr/bin/ld: font_renderer.cpp:(.text._ZZN8pybind117capsuleC4EPKvPFvPvEENKUlP7_objectE_clES7_[_ZZN8pybind117capsuleC4EPKvPFvPvEENKUlP7_objectE_clES7_]+0x2d): undefined reference to `PyCapsule_GetPointer'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11::capsule::capsule(void const*, void (*)(void*))':
font_renderer.cpp:(.text._ZN8pybind117capsuleC2EPKvPFvPvE[_ZN8pybind117capsuleC5EPKvPFvPvE]+0x4c): undefined reference to `PyCapsule_New'
/usr/bin/ld: font_renderer.cpp:(.text._ZN8pybind117capsuleC2EPKvPFvPvE[_ZN8pybind117capsuleC5EPKvPFvPvE]+0x84): undefined reference to `PyCapsule_SetContext'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11::capsule::set_pointer(void const*)':
font_renderer.cpp:(.text._ZN8pybind117capsule11set_pointerEPKv[_ZN8pybind117capsule11set_pointerEPKv]+0x22): undefined reference to `PyCapsule_SetPointer'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11::capsule::name() const':
font_renderer.cpp:(.text._ZNK8pybind117capsule4nameEv[_ZNK8pybind117capsule4nameEv]+0x17): undefined reference to `PyCapsule_GetName'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11::tuple::tuple(pybind11::object const&amp;)':
font_renderer.cpp:(.text._ZN8pybind115tupleC2ERKNS_6objectE[_ZN8pybind115tupleC5ERKNS_6objectE]+0x5f): undefined reference to `PySequence_Tuple'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11::tuple::tuple(unsigned long)':
font_renderer.cpp:(.text._ZN8pybind115tupleC2Em[_ZN8pybind115tupleC5Em]+0x2c): undefined reference to `PyTuple_New'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11::tuple::size() const':
font_renderer.cpp:(.text._ZNK8pybind115tuple4sizeEv[_ZNK8pybind115tuple4sizeEv]+0x17): undefined reference to `PyTuple_Size'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11::dict::dict()':
font_renderer.cpp:(.text._ZN8pybind114dictC2Ev[_ZN8pybind114dictC5Ev]+0x21): undefined reference to `PyDict_New'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11::dict::size() const':
font_renderer.cpp:(.text._ZNK8pybind114dict4sizeEv[_ZNK8pybind114dict4sizeEv]+0x17): undefined reference to `PyDict_Size'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11::list::list(unsigned long)':
font_renderer.cpp:(.text._ZN8pybind114listC2Em[_ZN8pybind114listC5Em]+0x2c): undefined reference to `PyList_New'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11::list::size() const':
font_renderer.cpp:(.text._ZNK8pybind114list4sizeEv[_ZNK8pybind114list4sizeEv]+0x17): undefined reference to `PyList_Size'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11::repr(pybind11::handle)':
font_renderer.cpp:(.text._ZN8pybind114reprENS_6handleE[_ZN8pybind114reprENS_6handleE]+0x35): undefined reference to `PyObject_Repr'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11::detail::translate_exception(std::__exception_ptr::exception_ptr)':
font_renderer.cpp:(.text._ZN8pybind116detail19translate_exceptionENSt15__exception_ptr13exception_ptrE[_ZN8pybind116detail19translate_exceptionENSt15__exception_ptr13exception_ptrE]+0x10e): undefined reference to `PyExc_MemoryError'
/usr/bin/ld: font_renderer.cpp:(.text._ZN8pybind116detail19translate_exceptionENSt15__exception_ptr13exception_ptrE[_ZN8pybind116detail19translate_exceptionENSt15__exception_ptr13exception_ptrE]+0x119): undefined reference to `PyErr_SetString'
/usr/bin/ld: font_renderer.cpp:(.text._ZN8pybind116detail19translate_exceptionENSt15__exception_ptr13exception_ptrE[_ZN8pybind116detail19translate_exceptionENSt15__exception_ptr13exception_ptrE]+0x151): undefined reference to `PyExc_ValueError'
/usr/bin/ld: font_renderer.cpp:(.text._ZN8pybind116detail19translate_exceptionENSt15__exception_ptr13exception_ptrE[_ZN8pybind116detail19translate_exceptionENSt15__exception_ptr13exception_ptrE]+0x15c): undefined reference to `PyErr_SetString'
/usr/bin/ld: font_renderer.cpp:(.text._ZN8pybind116detail19translate_exceptionENSt15__exception_ptr13exception_ptrE[_ZN8pybind116detail19translate_exceptionENSt15__exception_ptr13exception_ptrE]+0x194): undefined reference to `PyExc_ValueError'
/usr/bin/ld: font_renderer.cpp:(.text._ZN8pybind116detail19translate_exceptionENSt15__exception_ptr13exception_ptrE[_ZN8pybind116detail19translate_exceptionENSt15__exception_ptr13exception_ptrE]+0x19f): undefined reference to `PyErr_SetString'
/usr/bin/ld: font_renderer.cpp:(.text._ZN8pybind116detail19translate_exceptionENSt15__exception_ptr13exception_ptrE[_ZN8pybind116detail19translate_exceptionENSt15__exception_ptr13exception_ptrE]+0x1d7): undefined reference to `PyExc_ValueError'
/usr/bin/ld: font_renderer.cpp:(.text._ZN8pybind116detail19translate_exceptionENSt15__exception_ptr13exception_ptrE[_ZN8pybind116detail19translate_exceptionENSt15__exception_ptr13exception_ptrE]+0x1e2): undefined reference to `PyErr_SetString'
/usr/bin/ld: font_renderer.cpp:(.text._ZN8pybind116detail19translate_exceptionENSt15__exception_ptr13exception_ptrE[_ZN8pybind116detail19translate_exceptionENSt15__exception_ptr13exception_ptrE]+0x21a): undefined reference to `PyExc_IndexError'
/usr/bin/ld: font_renderer.cpp:(.text._ZN8pybind116detail19translate_exceptionENSt15__exception_ptr13exception_ptrE[_ZN8pybind116detail19translate_exceptionENSt15__exception_ptr13exception_ptrE]+0x225): undefined reference to `PyErr_SetString'
/usr/bin/ld: font_renderer.cpp:(.text._ZN8pybind116detail19translate_exceptionENSt15__exception_ptr13exception_ptrE[_ZN8pybind116detail19translate_exceptionENSt15__exception_ptr13exception_ptrE]+0x25d): undefined reference to `PyExc_ValueError'
/usr/bin/ld: font_renderer.cpp:(.text._ZN8pybind116detail19translate_exceptionENSt15__exception_ptr13exception_ptrE[_ZN8pybind116detail19translate_exceptionENSt15__exception_ptr13exception_ptrE]+0x268): undefined reference to `PyErr_SetString'
/usr/bin/ld: font_renderer.cpp:(.text._ZN8pybind116detail19translate_exceptionENSt15__exception_ptr13exception_ptrE[_ZN8pybind116detail19translate_exceptionENSt15__exception_ptr13exception_ptrE]+0x2a0): undefined reference to `PyExc_OverflowError'
/usr/bin/ld: font_renderer.cpp:(.text._ZN8pybind116detail19translate_exceptionENSt15__exception_ptr13exception_ptrE[_ZN8pybind116detail19translate_exceptionENSt15__exception_ptr13exception_ptrE]+0x2ab): undefined reference to `PyErr_SetString'
/usr/bin/ld: font_renderer.cpp:(.text._ZN8pybind116detail19translate_exceptionENSt15__exception_ptr13exception_ptrE[_ZN8pybind116detail19translate_exceptionENSt15__exception_ptr13exception_ptrE]+0x2e3): undefined reference to `PyExc_RuntimeError'
/usr/bin/ld: font_renderer.cpp:(.text._ZN8pybind116detail19translate_exceptionENSt15__exception_ptr13exception_ptrE[_ZN8pybind116detail19translate_exceptionENSt15__exception_ptr13exception_ptrE]+0x2ee): undefined reference to `PyErr_SetString'
/usr/bin/ld: font_renderer.cpp:(.text._ZN8pybind116detail19translate_exceptionENSt15__exception_ptr13exception_ptrE[_ZN8pybind116detail19translate_exceptionENSt15__exception_ptr13exception_ptrE]+0x308): undefined reference to `PyExc_RuntimeError'
/usr/bin/ld: font_renderer.cpp:(.text._ZN8pybind116detail19translate_exceptionENSt15__exception_ptr13exception_ptrE[_ZN8pybind116detail19translate_exceptionENSt15__exception_ptr13exception_ptrE]+0x31a): undefined reference to `PyErr_SetString'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11::detail::get_internals()::gil_scoped_acquire_local::gil_scoped_acquire_local()':
font_renderer.cpp:(.text._ZZN8pybind116detail13get_internalsEvEN24gil_scoped_acquire_localC2Ev[_ZZN8pybind116detail13get_internalsEvEN24gil_scoped_acquire_localC5Ev]+0xd): undefined reference to `PyGILState_Ensure'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11::detail::get_internals()::gil_scoped_acquire_local::~gil_scoped_acquire_local()':
font_renderer.cpp:(.text._ZZN8pybind116detail13get_internalsEvEN24gil_scoped_acquire_localD2Ev[_ZZN8pybind116detail13get_internalsEvEN24gil_scoped_acquire_localD5Ev]+0x15): undefined reference to `PyGILState_Release'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11::detail::get_internals()':
font_renderer.cpp:(.text._ZN8pybind116detail13get_internalsEv[_ZN8pybind116detail13get_internalsEv]+0x75): undefined reference to `PyEval_GetBuiltins'
/usr/bin/ld: font_renderer.cpp:(.text._ZN8pybind116detail13get_internalsEv[_ZN8pybind116detail13get_internalsEv]+0x1e2): undefined reference to `PyThreadState_Get'
/usr/bin/ld: font_renderer.cpp:(.text._ZN8pybind116detail13get_internalsEv[_ZN8pybind116detail13get_internalsEv]+0x1f2): undefined reference to `PyThread_tss_alloc'
/usr/bin/ld: font_renderer.cpp:(.text._ZN8pybind116detail13get_internalsEv[_ZN8pybind116detail13get_internalsEv]+0x222): undefined reference to `PyThread_tss_create'
/usr/bin/ld: font_renderer.cpp:(.text._ZN8pybind116detail13get_internalsEv[_ZN8pybind116detail13get_internalsEv]+0x262): undefined reference to `PyThread_tss_set'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11::detail::loader_life_support::add_patient(pybind11::handle)':
font_renderer.cpp:(.text._ZN8pybind116detail19loader_life_support11add_patientENS_6handleE[_ZN8pybind116detail19loader_life_support11add_patientENS_6handleE]+0x8f): undefined reference to `PyList_New'
/usr/bin/ld: font_renderer.cpp:(.text._ZN8pybind116detail19loader_life_support11add_patientENS_6handleE[_ZN8pybind116detail19loader_life_support11add_patientENS_6handleE]+0x13d): undefined reference to `PyList_Append'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11::detail::instance::allocate_layout()':
font_renderer.cpp:(.text._ZN8pybind116detail8instance15allocate_layoutEv[_ZN8pybind116detail8instance15allocate_layoutEv]+0x178): undefined reference to `PyMem_Calloc'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11::detail::instance::deallocate_layout()':
font_renderer.cpp:(.text._ZN8pybind116detail8instance17deallocate_layoutEv[_ZN8pybind116detail8instance17deallocate_layoutEv]+0x2c): undefined reference to `PyMem_Free'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11::detail::error_string[abi:cxx11]()':
font_renderer.cpp:(.text._ZN8pybind116detail12error_stringB5cxx11Ev[_ZN8pybind116detail12error_stringB5cxx11Ev]+0x23): undefined reference to `PyErr_Occurred'
/usr/bin/ld: font_renderer.cpp:(.text._ZN8pybind116detail12error_stringB5cxx11Ev[_ZN8pybind116detail12error_stringB5cxx11Ev]+0x34): undefined reference to `PyExc_RuntimeError'
/usr/bin/ld: font_renderer.cpp:(.text._ZN8pybind116detail12error_stringB5cxx11Ev[_ZN8pybind116detail12error_stringB5cxx11Ev]+0x46): undefined reference to `PyErr_SetString'
/usr/bin/ld: font_renderer.cpp:(.text._ZN8pybind116detail12error_stringB5cxx11Ev[_ZN8pybind116detail12error_stringB5cxx11Ev]+0x1fd): undefined reference to `PyErr_NormalizeException'
/usr/bin/ld: font_renderer.cpp:(.text._ZN8pybind116detail12error_stringB5cxx11Ev[_ZN8pybind116detail12error_stringB5cxx11Ev]+0x222): undefined reference to `PyException_SetTraceback'
/usr/bin/ld: font_renderer.cpp:(.text._ZN8pybind116detail12error_stringB5cxx11Ev[_ZN8pybind116detail12error_stringB5cxx11Ev]+0x2a3): undefined reference to `PyFrame_GetLineNumber'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11::detail::get_thread_state_unchecked()':
font_renderer.cpp:(.text._ZN8pybind116detail26get_thread_state_uncheckedEv[_ZN8pybind116detail26get_thread_state_uncheckedEv]+0x5): undefined reference to `_PyThreadState_UncheckedGet'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11::detail::type_caster&lt;bool, void&gt;::load(pybind11::handle, bool)':
font_renderer.cpp:(.text._ZN8pybind116detail11type_casterIbvE4loadENS_6handleEb[_ZN8pybind116detail11type_casterIbvE4loadENS_6handleEb]+0x45): undefined reference to `_Py_TrueStruct'
/usr/bin/ld: font_renderer.cpp:(.text._ZN8pybind116detail11type_casterIbvE4loadENS_6handleEb[_ZN8pybind116detail11type_casterIbvE4loadENS_6handleEb]+0x76): undefined reference to `_Py_FalseStruct'
/usr/bin/ld: font_renderer.cpp:(.text._ZN8pybind116detail11type_casterIbvE4loadENS_6handleEb[_ZN8pybind116detail11type_casterIbvE4loadENS_6handleEb]+0x173): undefined reference to `PyErr_Clear'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11_static_get':
font_renderer.cpp:(.text.pybind11_static_get[pybind11_static_get]+0x17): undefined reference to `PyProperty_Type'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11_static_set':
font_renderer.cpp:(.text.pybind11_static_set[pybind11_static_set]+0x39): undefined reference to `PyProperty_Type'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11::detail::make_static_property_type()':
font_renderer.cpp:(.text._ZN8pybind116detail25make_static_property_typeEv[_ZN8pybind116detail25make_static_property_typeEv]+0x2e): undefined reference to `PyUnicode_FromString'
/usr/bin/ld: font_renderer.cpp:(.text._ZN8pybind116detail25make_static_property_typeEv[_ZN8pybind116detail25make_static_property_typeEv]+0x5a): undefined reference to `PyType_Type'
/usr/bin/ld: font_renderer.cpp:(.text._ZN8pybind116detail25make_static_property_typeEv[_ZN8pybind116detail25make_static_property_typeEv]+0x66): undefined reference to `PyType_Type'
/usr/bin/ld: font_renderer.cpp:(.text._ZN8pybind116detail25make_static_property_typeEv[_ZN8pybind116detail25make_static_property_typeEv]+0xe1): undefined reference to `PyProperty_Type'
/usr/bin/ld: font_renderer.cpp:(.text._ZN8pybind116detail25make_static_property_typeEv[_ZN8pybind116detail25make_static_property_typeEv]+0x133): undefined reference to `PyType_Ready'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11_meta_setattro':
font_renderer.cpp:(.text.pybind11_meta_setattro[pybind11_meta_setattro]+0x23): undefined reference to `_PyType_Lookup'
/usr/bin/ld: font_renderer.cpp:(.text.pybind11_meta_setattro[pybind11_meta_setattro]+0x58): undefined reference to `PyObject_IsInstance'
/usr/bin/ld: font_renderer.cpp:(.text.pybind11_meta_setattro[pybind11_meta_setattro]+0x6f): undefined reference to `PyObject_IsInstance'
/usr/bin/ld: font_renderer.cpp:(.text.pybind11_meta_setattro[pybind11_meta_setattro]+0xb5): undefined reference to `PyType_Type'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11_meta_getattro':
font_renderer.cpp:(.text.pybind11_meta_getattro[pybind11_meta_getattro]+0x1f): undefined reference to `_PyType_Lookup'
/usr/bin/ld: font_renderer.cpp:(.text.pybind11_meta_getattro[pybind11_meta_getattro]+0x35): undefined reference to `PyInstanceMethod_Type'
/usr/bin/ld: font_renderer.cpp:(.text.pybind11_meta_getattro[pybind11_meta_getattro]+0x6d): undefined reference to `PyType_Type'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11_meta_call':
font_renderer.cpp:(.text.pybind11_meta_call[pybind11_meta_call]+0x33): undefined reference to `PyType_Type'
/usr/bin/ld: font_renderer.cpp:(.text.pybind11_meta_call[pybind11_meta_call]+0x134): undefined reference to `PyExc_TypeError'
/usr/bin/ld: font_renderer.cpp:(.text.pybind11_meta_call[pybind11_meta_call]+0x14b): undefined reference to `PyErr_Format'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11_meta_dealloc':
font_renderer.cpp:(.text.pybind11_meta_dealloc[pybind11_meta_dealloc]+0x22b): undefined reference to `PyType_Type'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11::detail::make_default_metaclass()':
font_renderer.cpp:(.text._ZN8pybind116detail22make_default_metaclassEv[_ZN8pybind116detail22make_default_metaclassEv]+0x2e): undefined reference to `PyUnicode_FromString'
/usr/bin/ld: font_renderer.cpp:(.text._ZN8pybind116detail22make_default_metaclassEv[_ZN8pybind116detail22make_default_metaclassEv]+0x5a): undefined reference to `PyType_Type'
/usr/bin/ld: font_renderer.cpp:(.text._ZN8pybind116detail22make_default_metaclassEv[_ZN8pybind116detail22make_default_metaclassEv]+0x66): undefined reference to `PyType_Type'
/usr/bin/ld: font_renderer.cpp:(.text._ZN8pybind116detail22make_default_metaclassEv[_ZN8pybind116detail22make_default_metaclassEv]+0xe1): undefined reference to `PyType_Type'
/usr/bin/ld: font_renderer.cpp:(.text._ZN8pybind116detail22make_default_metaclassEv[_ZN8pybind116detail22make_default_metaclassEv]+0x154): undefined reference to `PyType_Ready'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11_object_init':
font_renderer.cpp:(.text.pybind11_object_init[pybind11_object_init]+0x81): undefined reference to `PyExc_TypeError'
/usr/bin/ld: font_renderer.cpp:(.text.pybind11_object_init[pybind11_object_init]+0x8c): undefined reference to `PyErr_SetString'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11::detail::clear_instance(_object*)':
font_renderer.cpp:(.text._ZN8pybind116detail14clear_instanceEP7_object[_ZN8pybind116detail14clear_instanceEP7_object]+0x1be): undefined reference to `PyObject_ClearWeakRefs'
/usr/bin/ld: font_renderer.cpp:(.text._ZN8pybind116detail14clear_instanceEP7_object[_ZN8pybind116detail14clear_instanceEP7_object]+0x1cd): undefined reference to `_PyObject_GetDictPtr'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11::detail::make_object_base_type(_typeobject*)':
font_renderer.cpp:(.text._ZN8pybind116detail21make_object_base_typeEP11_typeobject[_ZN8pybind116detail21make_object_base_typeEP11_typeobject]+0x38): undefined reference to `PyUnicode_FromString'
/usr/bin/ld: font_renderer.cpp:(.text._ZN8pybind116detail21make_object_base_typeEP11_typeobject[_ZN8pybind116detail21make_object_base_typeEP11_typeobject]+0xfb): undefined reference to `PyBaseObject_Type'
/usr/bin/ld: font_renderer.cpp:(.text._ZN8pybind116detail21make_object_base_typeEP11_typeobject[_ZN8pybind116detail21make_object_base_typeEP11_typeobject]+0x177): undefined reference to `PyType_Ready'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11_get_dict':
font_renderer.cpp:(.text.pybind11_get_dict[pybind11_get_dict]+0x18): undefined reference to `_PyObject_GetDictPtr'
/usr/bin/ld: font_renderer.cpp:(.text.pybind11_get_dict[pybind11_get_dict]+0x2d): undefined reference to `PyDict_New'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11_set_dict':
font_renderer.cpp:(.text.pybind11_set_dict[pybind11_set_dict]+0x6b): undefined reference to `PyExc_TypeError'
/usr/bin/ld: font_renderer.cpp:(.text.pybind11_set_dict[pybind11_set_dict]+0x82): undefined reference to `PyErr_Format'
/usr/bin/ld: font_renderer.cpp:(.text.pybind11_set_dict[pybind11_set_dict]+0xa1): undefined reference to `_PyObject_GetDictPtr'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11_traverse':
font_renderer.cpp:(.text.pybind11_traverse[pybind11_traverse]+0x1c): undefined reference to `_PyObject_GetDictPtr'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11_clear':
font_renderer.cpp:(.text.pybind11_clear[pybind11_clear]+0x14): undefined reference to `_PyObject_GetDictPtr'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11_getbuffer':
font_renderer.cpp:(.text.pybind11_getbuffer[pybind11_getbuffer]+0x128): undefined reference to `PyExc_BufferError'
/usr/bin/ld: font_renderer.cpp:(.text.pybind11_getbuffer[pybind11_getbuffer]+0x13a): undefined reference to `PyErr_SetString'
/usr/bin/ld: font_renderer.cpp:(.text.pybind11_getbuffer[pybind11_getbuffer]+0x1b8): undefined reference to `PyExc_BufferError'
/usr/bin/ld: font_renderer.cpp:(.text.pybind11_getbuffer[pybind11_getbuffer]+0x1ca): undefined reference to `PyErr_SetString'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11::detail::make_new_python_type(pybind11::detail::type_record const&amp;)':
font_renderer.cpp:(.text._ZN8pybind116detail20make_new_python_typeERKNS0_11type_recordE[_ZN8pybind116detail20make_new_python_typeERKNS0_11type_recordE]+0x39): undefined reference to `PyUnicode_FromString'
/usr/bin/ld: font_renderer.cpp:(.text._ZN8pybind116detail20make_new_python_typeERKNS0_11type_recordE[_ZN8pybind116detail20make_new_python_typeERKNS0_11type_recordE]+0xac): undefined reference to `PyModule_Type'
/usr/bin/ld: font_renderer.cpp:(.text._ZN8pybind116detail20make_new_python_typeERKNS0_11type_recordE[_ZN8pybind116detail20make_new_python_typeERKNS0_11type_recordE]+0x14a): undefined reference to `PyUnicode_FromFormat'
/usr/bin/ld: font_renderer.cpp:(.text._ZN8pybind116detail20make_new_python_typeERKNS0_11type_recordE[_ZN8pybind116detail20make_new_python_typeERKNS0_11type_recordE]+0x4a9): undefined reference to `PyObject_Malloc'
/usr/bin/ld: font_renderer.cpp:(.text._ZN8pybind116detail20make_new_python_typeERKNS0_11type_recordE[_ZN8pybind116detail20make_new_python_typeERKNS0_11type_recordE]+0x86c): undefined reference to `PyType_Ready'
/usr/bin/ld: libfont_renderer.a(font_renderer.cpp.o): in function `pybind11::cpp_function::initialize_generic(std::unique_ptr&lt;pybind11::detail::function_record, pybind11::cpp_function::InitializingFunctionRecordDeleter&gt;&amp;&amp;, char const*, std::type_info const* const*, unsigned long)':
</code></pre>