Debug mex code using visual studio <p>Hi I have written a mex file and I would like to debug it using visual studio 2010. I followed steps mentioned in Mathwork website :</p> <p><a href="http://www.mathworks.com/help/matlab/matlab_external/debugging-on-microsoft-windows-platforms.html" rel="nofollow">http://www.mathworks.com/help/matlab/matlab_external/debugging-on-microsoft-windows-platforms.html</a></p> <p>I have also read following posts:</p> <p><a href="http://stackoverflow.com/questions/13610959/how-to-debug-matlab-mex32-mex64-files-with-visual-studio-2010">how to debug MATLAB .mex32/.mex64 files with Visual Studio 2010</a></p> <p>I should mention that I can compile mex with -g code successfully but when I insert the breakpoint it says: the breakpoint cannot be currently hit. No symbols have been loaded for this document.</p> <p>Then when I run the mex code from Matlab, it does not create any break point and it does not do the debugging.</p> <p>According to the following : <a href="http://stackoverflow.com/questions/2155930/fixing-the-breakpoint-will-not-currently-be-hit-no-symbols-have-been-loaded-fo">Fixing &quot;The breakpoint will not currently be hit. No symbols have been loaded for this document.&quot;</a> When I go to debug--> windows--> module--> next to matlab says cannot find or open the PDB file. I do not understand what he means when he says</p> <p>" In normal projects, the assembly and its .pdb file should always have been copied by the IDE into the same folder as your .exe. The bin\Debug folder of your project. Make sure you remove one from the GAC if you've been playing with it." </p> <p>my Matlab is located in C:\Program Files\MATLAB\R2012a and the mex and pdb file is in C:\Documents\Matlab file but I copied the pdb file (I do not know it is necessary or not) to Matlab workspace. The Matlab current folder that code is running is also C:\Documents\Matlab. Can anyone please help me to solve this problem.</p> <p>Can anyone please hel me to solve this problem?</p>