Windows Debugging with Visual C/C++ (VS)¶
- Edit the compile_mex.bat and set the paths of your GMT, NETCDF and GDAL installations.
- Run the compile_mex.bat, which will create these two files: gmtmex.mexw64 and a gmtmex.pdb
- Put those files somewhere under the MATLAB path, and remember that the GMT bin dir must on the Windows path as well so that the dependencies may be found by MATLAB.
- To debug: in VS connect the MATLAB process via "Tools → Attach to process..". You are now ready to debug. In VS load the gmt-mex\trunk\src\gmtmex.c code and set breakpoints. When you run the gmt MEX from MATLAB it will stop at the breakpoints.