**具体问题是:我想把现有的.cpp文件转成.mexw32的文件,代码没有出现错误,因为前辈曾转出过64位的。**
而且配置应该没问题,因为mex代码中其他.cpp文件是可以做出来的,唯独这个出现以下错误:
mex mex_maxflow.cpp
正在创建库 C:\DOCUME~1\ADMINI~1\LOCALS~1\TEMP\MEX_4W~1\templib.x 和对象 C:\DOCUME~1\ADMINI~1\LOCALS~1\TEMP\MEX_4W~1\templib.exp
mex_maxflow.obj : error LNK2019: 无法解析的外部符号 "public: thiscall Graph::~Graph(void)" (??1?$Graph@NNN@@QAE@XZ),该符号在函数 "public: void * __thiscall Graph::`scalar deleting destructor'(unsigned int)" (??_G?$Graph@NNN@@QAEPAXI@Z) 中被引用
mex_maxflow.obj : error LNK2019: 无法解析的外部符号 "private: void __thiscall Graph::reallocate_nodes(int)" (?reallocate_nodes@?$Graph@NNN@@AAEXH@Z),该符号在函数 "public: int __thiscall Graph::add_node(int)" (?add_node@?$Graph@NNN@@QAEHH@Z) 中被引用
mex_maxflow.obj : error LNK2019: 无法解析的外部符号 "private: void __thiscall Graph::reallocate_arcs(void)" (?reallocate_arcs@?$Graph@NNN@@AAEXXZ),该符号在函数 "public: void __thiscall Graph::add_edge(int,int,double,double)" (?add_edge@?$Graph@NNN@@QAEXHHNN@Z) 中被引用
mex_maxflow.obj : error LNK2019: 无法解析的外部符号 "public: double __thiscall Graph::maxflow(bool,class Block *)" (?maxflow@?$Graph@NNN@@QAEN_NPAV?$Block@H@@@Z),该符号在函数 _mexFunction 中被引用
mex_maxflow.obj : error LNK2019: 无法解析的外部符号 "public: __thiscall Graph::Graph(int,int,void (cdecl*)(char *))" (??0?$Graph@NNN@@QAE@HHP6AXPAD@Z@Z),该符号在函数 _mexFunction 中被引用
mex_maxflow.mexw32 : fatal error LNK1120: 5 个无法解析的外部命令
E:\MATLAB~3\BIN\MEX.PL: Error: Link of 'mex_maxflow.mexw32' failed.
折腾好久了也没结果,我试着更改文件名也存在错误,查了很多资料有些用vs编译的说是.lib调用问题,不过感觉和matlab进行mex是两回事么?好像是编译的文件引用了mexFuntion中文件,就是上面错误中说到的。请大家帮忙分析一下,不胜感激。仅有的1c币奉上