matlab进行mex时出现 error LNK2019: 无法解析的外部符号……

  **具体问题是:我想把现有的.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币奉上

应该是你当前的cpp有用其他cpp中实现的类,函数等,造成link的时候找不到实现。
你可以把用到的其他cpp文件中的实现复制一份到当前cpp。再编译。

把用到的在mex的时候声明一下就行了
mex a.c b.c c.c -output c.mexw64

谢谢 一直用MATLAB 刚开始cpp的混编 很没头绪 重建项目重建文件都没成功,后来换系统了,直接调用现成的64mex啦,呵呵,谢谢啦

网上download的代码,里面的cpp是自带的,这样一来就尴尬了,看来要联系原作者了