• C++使用pybind11编译动态库出错


    (learnROS) xlm@xlm-Legion-Y7000P-IAH7:~/fuxian/VoxelNet-pytorch-master/nms/src/build/lib.linux-x86_64-cpython-39$ ldd -r _ext.cpython-39-x86_64-linux-gnu.so
    	linux-vdso.so.1 (0x00007ffe6e3c9000)
    	libstdc++.so.6 => /home/xlm/anaconda3/envs/learnROS/lib/libstdc++.so.6 (0x00007f19e9240000)
    	libgcc_s.so.1 => /home/xlm/anaconda3/envs/learnROS/lib/libgcc_s.so.1 (0x00007f19e9226000)
    	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f19e91c0000)
    	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f19e8fce000)
    	/lib64/ld-linux-x86-64.so.2 (0x00007f19e9477000)
    	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f19e8e7f000)
    undefined symbol: _ZTVN5torch8autograd12AutogradMetaE	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyInstanceMethod_Type	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyExc_ValueError	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyExc_IndexError	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyCapsule_Type	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: _Py_NoneStruct	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: THPVariableClass	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyExc_MemoryError	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyType_Type	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyByteArray_Type	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyCFunction_Type	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyExc_OverflowError	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyProperty_Type	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyExc_RuntimeError	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: _Py_NotImplementedStruct	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyBaseObject_Type	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyExc_TypeError	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: _ZN3c1019UndefinedTensorImpl10_singletonE	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyDict_Type	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyFloat_Type	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyExc_SystemError	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyExc_ImportError	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyTuple_SetItem	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyObject_Repr	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyLong_FromSsize_t	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyByteArray_Size	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyErr_NormalizeException	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyInstanceMethod_New	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyEval_AcquireThread	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyObject_Str	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyThreadState_DeleteCurrent	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyGILState_GetThisThreadState	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyObject_GetAttrString	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyMem_Free	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyErr_Restore	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: _ZN3c104impl23ExcludeDispatchKeyGuardC1ENS_14DispatchKeySetE	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyType_IsSubtype	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyModule_AddObject	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyCapsule_SetPointer	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyTuple_New	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyObject_IsInstance	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: _ZNK2at6Tensor8data_ptrIfEEPT_v	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyException_SetTraceback	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyNumber_Float	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyDict_Next	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyTuple_Size	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyErr_Format	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyObject_CallObject	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyFloat_AsDouble	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: _ZN3c1010TensorImpl17set_autograd_metaESt10unique_ptrINS_21AutogradMetaInterfaceESt14default_deleteIS2_EE	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: _Py_Dealloc	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyByteArray_AsString	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyNumber_Check	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: _PyObject_GetDictPtr	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyUnicode_FromString	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: Py_GetVersion	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyCapsule_SetContext	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyFrame_GetLineNumber	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyThread_tss_get	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyBytes_Size	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyException_SetContext	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyErr_Clear	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyObject_HasAttrString	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyWeakref_NewRef	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyDict_New	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyErr_SetString	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: _ZN3c105ErrorC1ENS_14SourceLocationENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyCapsule_GetContext	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: _ZN3c106detail14torchCheckFailEPKcS2_jRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyThreadState_Get	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyObject_SetItem	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyCapsule_New	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyMem_Calloc	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyObject_SetAttrString	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyGILState_Release	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyCapsule_GetPointer	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyThread_tss_alloc	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: _nms	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyBytes_AsString	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: _ZN2at5zerosEN3c108ArrayRefIlEENS0_13TensorOptionsE	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyDict_GetItemWithError	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyThread_tss_set	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyType_Ready	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: _ZN3c104impl23ExcludeDispatchKeyGuardD1Ev	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyEval_SaveThread	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyObject_ClearWeakRefs	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyObject_GC_UnTrack	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyEval_GetBuiltins	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyErr_WriteUnraisable	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyModule_Create2	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyThread_tss_create	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyFrame_GetBack	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyUnicode_AsEncodedString	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyErr_Occurred	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: _ZN3c105ErrorC2ENS_14SourceLocationENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyDict_Copy	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: _ZN6caffe28TypeMeta26error_unsupported_typemetaES0_	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyErr_Fetch	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyThreadState_New	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: _PyThreadState_UncheckedGet	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: _PyType_Lookup	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyObject_CallFunctionObjArgs	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyDict_Size	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyThreadState_Clear	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyDict_DelItemString	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: _ZN3c1021AutogradMetaInterfaceD2Ev	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyUnicode_AsUTF8AndSize	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyGILState_Ensure	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyCMethod_New	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyCapsule_GetName	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyTuple_GetItem	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyFrame_GetCode	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyException_SetCause	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyUnicode_AsUTF8String	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: _ZNK2at6Tensor8data_ptrIyEEPT_v	(./_ext.cpython-39-x86_64-linux-gnu.so)
    undefined symbol: PyBytes_AsStringAndSize	(./_ext.cpython-39-x86_64-linux-gnu.so)
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77
    • 78
    • 79
    • 80
    • 81
    • 82
    • 83
    • 84
    • 85
    • 86
    • 87
    • 88
    • 89
    • 90
    • 91
    • 92
    • 93
    • 94
    • 95
    • 96
    • 97
    • 98
    • 99
    • 100
    • 101
    • 102
    • 103
    • 104
    • 105
    • 106
    • 107
    • 108
    • 109
    • 110
    • 111
    • 112
    • 113
    • 114
    • 115
    • 116
    • 117
    • 118
    • 119
    • 120
    • 121
    • 122
    • 123
    • 124
  • 相关阅读:
    Win11怎么设置用独立显卡来运行游戏
    Golang Channel 实战技巧和说明
    短视频剪辑矩阵系统开发源码----源头搭建
    前端实现类似公告的无缝横向滚动
    【机器学习】21天挑战赛学习笔记(四)
    全网最全jmeter接口测试/接口自动化测试看这篇文章就够了:跨线程组传递jmeter变量及cookie的处理
    rk3588编译lunch出错
    C++ priority_queue如何自定义比较函数?和sort里面自定义比较函数有何区别?
    deepin换阿里镜像源
    夯实算法-课程表
  • 原文地址:https://blog.csdn.net/qq_44992157/article/details/133205920