Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Facing issue while compiling /Debugging the MEX file.
Replies: 1   Last Post: Mar 5, 2014 4:40 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
sharoze ali

Posts: 30
Registered: 10/7/13
Facing issue while compiling /Debugging the MEX file.
Posted: Mar 2, 2014 5:27 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hi All,
I have a application in matlab which uses vc++ for MaxFlow Computation .To use VC++ Code I have written a mex file . I have goggled about it,i.e how to debug mex file and found this below website .
http://www.mathworks.se/help/matlab/matlab_external/debugging-c-c-language-mex-files.html
Method 1 :- Compiling the mex as in above web site
While iam debugging according to this, iam getting issue below issue while aim compile the source MEX-file with the -g option (mex -g yprime.c) Step 2 as in above website . So can any one can help me in resolving this issue
>> mex -g maxflowmex.cpp
Microsoft (R) Incremental Linker Version 9.00.21022.08
Copyright (C) Microsoft Corporation. All rights reserved.

E:\Users\Sharoze\AppData\Local\Temp\mex_HRNpMQ\maxflowmex.obj
Creating library E:\Users\Sharoze\AppData\Local\Temp\mex_HRNpMQ\templib.x and object E:\Users\Sharoze\AppData\Local\Temp\mex_HRNpMQ\templib.exp
maxflowmex.obj : error LNK2019: unresolved external symbol "public: int __thiscall IBFSGraph::computeMaxFlow(void)" (?computeMaxFlow@IBFSGraph@@QAEHXZ) referenced in function "void __cdecl maxflowmex(int,struct mxArray_tag * * const,int,struct mxArray_tag const * * const)" (?maxflowmex@@YAXHQAPAUmxArray_tag@@HQAPBU1@@Z)
maxflowmex.obj : error LNK2019: unresolved external symbol "public: void __thiscall IBFSGraph::initGraph(void)" (?initGraph@IBFSGraph@@QAEXXZ) referenced in function "void __cdecl maxflowmex(int,struct mxArray_tag * * const,int,struct mxArray_tag const * * const)" (?maxflowmex@@YAXHQAPAUmxArray_tag@@HQAPBU1@@Z)
maxflowmex.obj : error LNK2019: unresolved external symbol "public: void __thiscall IBFSGraph::initSize(int,int)" (?initSize@IBFSGraph@@QAEXHH@Z) referenced in function "void __cdecl maxflowmex(int,struct mxArray_tag * * const,int,struct mxArray_tag const * * const)" (?maxflowmex@@YAXHQAPAUmxArray_tag@@HQAPBU1@@Z)
maxflowmex.obj : error LNK2019: unresolved external symbol "public: __thiscall IBFSGraph::IBFSGraph(void)" (??0IBFSGraph@@QAE@XZ) referenced in function "void __cdecl maxflowmex(int,struct mxArray_tag * * const,int,struct mxArray_tag const * * const)" (?maxflowmex@@YAXHQAPAUmxArray_tag@@HQAPBU1@@Z)
maxflowmex.mexw32 : fatal error LNK1120: 4 unresolved externals

E:\PROGRA~1\MATLAB\R2008A\BIN\MEX.PL: Error: Link of 'maxflowmex.mexw32' failed.

??? Error using ==> mex at 207
Unable to complete successfully.
Method 2 :- Make a make file and running through command window
Instead of doing as the above procedure(method 1 ) I have written a make file which points to this mex.cpp and when I run from command window mex is generated .But while iam running this mex iam facing issue which is related to the Graph Cut .Now my question is how can I debug the code in VC++ 2008 and can see where exactly (code line no )this issue arises .How can I solve this .Anyone help regarding the above two issues will be highly appreciated .

Iam using the Matlab R 2008a and Microsoft Visual C++ 2008 in E:\Program Files\Microsoft Visual Studio 9.0 to compile Mex file .

Best Regards,
Sharoze



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.