我将一个dll加载到matlab中:
[met,b]=loadlibrary([geodesic_library '.dll'], hfile);
然后我从 dll 中调用一个函数,如下所示:
[id, tmp1, tmp2, num_edges, edges] = calllib(geodesic_library, 'new_mesh', length(p)/3, p, length(t)/3, t, 1, tmp);
这会产生错误
Method was not found.
但是查看库中的方法,我清楚地看到该方法存在:
met =
Columns 1 through 4
'new_mesh' 'new_algorithm' 'delete_algorithm' 'delete_mesh'
Columns 5 through 8
'propagate' 'trace_back' 'distance_and_source' [1x36 char]
这也是以下内容b
:
geodesic_matlab_api.h
geodesic_release_thunk_pcwin64.c
Creating library geodesic_release_thunk_pcwin64.lib and object geodesic_release_thunk_pcwin64.exp
但是,当我打电话时,M = libfunctions([geodesic_library '.dll']
我得到的M
是空的。
我正在使用应该可以工作的原作者的示例代码,唯一的问题是我将 c++ 代码重新编译为 64 位 DLL