我使用cmake add_library编译了一个库(object3d共享了一些_文件.h一些_文件.cpp)。
编译之后,我得到一个文件:libobject3d.so
void ComputeGeometryImage(char * input_image, int geometry_image_size, float * output);
我确实通过执行以下操作检查了我的库中是否存在此方法:
nm libobject3d.so
0000000000202058 d DW.ref.__gxx_personality_v0
0000000000201d40 a _DYNAMIC
0000000000201fe8 a _GLOBAL_OFFSET_TABLE_
0000000000000cbd t _GLOBAL__I_export_object3d_lib.cpp
w _Jv_RegisterClasses
0000000000000bdc T _Z20ComputeGeometryImagePciPf
0000000000000c75 t _Z41__static_initialization_and_destruction_0ii
U _Z7load_3dPKci
0000000000000cd2 W _ZN7Image2DIfE10get_accessEv
0000000000000ce8 W _ZN7Image2DIfED1Ev
U _ZNK8Object3D18convert_to_Image2DEi
U _ZNSt8ios_base4InitC1Ev@@GLIBCXX_3.4
U _ZNSt8ios_base4InitD1Ev@@GLIBCXX_3.4
0000000000202070 b _ZStL8__ioinit
U _ZdaPv@@GLIBCXX_3.4
U _ZdlPv@@GLIBCXX_3.4
0000000000201d20 d __CTOR_END__
0000000000201d10 d __CTOR_LIST__
0000000000201d30 d __DTOR_END__
0000000000201d28 d __DTOR_LIST__
0000000000000e70 r __FRAME_END__
0000000000201d38 d __JCR_END__
0000000000201d38 d __JCR_LIST__
0000000000202060 A __bss_start
U __cxa_atexit@@GLIBC_2.2.5
w __cxa_finalize@@GLIBC_2.2.5
0000000000000d30 t __do_global_ctors_aux
0000000000000b30 t __do_global_dtors_aux
0000000000202050 d __dso_handle
w __gmon_start__
U __gxx_personality_v0@@CXXABI_1.3
0000000000202060 A _edata
0000000000202078 A _end
0000000000000d68 T _fini
0000000000000a40 T _init
0000000000000b10 t call_gmon_start
0000000000202060 b completed.7382
0000000000202068 b dtor_idx.7384
0000000000000bb0 t frame_dummy
U memcpy@@GLIBC_2.2.5
lib = np.ctypeslib.load_library('libobject3d.so', '.')
此库对象没有对象ComputeGeometryImage。即lib.ComputeGeometryImage不存在。
这是我的图书馆的问题吗?如何将此方法从C++暴露为cType?