View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Join the 15-year community celebration.

Play games and win prizes!

» Learn more

4.66667
4.7 | 3 ratings Rate this file 5 Downloads (last 30 days) File Size: 5.71 KB File ID: #39549 Version: 1.7
image thumbnail

Visual Studio Toolbar for mex interface with video tutorial

by

Stefan Karlsson (view profile)

 

20 Dec 2012 (Updated )

Seamless interface, VS 2010 and 2012 and Matlab for MEX. Video linked to step you through.

| Watch this File

File Information
Description

Automatically sets up debugging and running of MEX files from Visual Studio.
There is now a visual studio extension (simple click plugin type of install):
http://islab.hh.se/mediawiki/images/b/b0/VSMEX1.0.zip

The old type of Macros (that are not supported in newer versions of Visual Studio) are kept in the same zip file.

Video tutorial on my page:
http://islab.hh.se/mediawiki/index.php/Stefan_Karlsson/PersonalPage/mex_VS_tutorial

On youtube:
http://www.youtube.com/watch?v=JKDlPQZQqHk

MATLAB release MATLAB 7.10 (R2010a)
MATLAB Search Path
/
/SourceMex_VS
Other requirements Visual Studio 2010, for the submission file. Follow the link: http://islab.hh.se/mediawiki/images/b/b0/VSMEX1.0.zip for a version that works on 2010 OR 2012
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (13)
03 Mar 2016 Tom Clark

@Stefan,
Thanks. I don't know about *all* functionality, but will see what I can come up with next time I boot my windows box.

Comment only
02 Mar 2016 Stefan Karlsson

Stefan Karlsson (view profile)

@Tom,

If you have info or links on how people may get the same functionality as this submission, through other means, please share. If its accurate, I will update the description of this submission to say DEPRECATED, and put your links in the description.

happy coding

Comment only
02 Mar 2016 Stefan Karlsson

Stefan Karlsson (view profile)

@Tom,

My knowledge about VS and mexing in Matlab is really out-dated, and its great to hear that things are evolving.

The VSmex extension (this FEX submission) to visual studio is really not about solving difficult problems - its about automating and speeding up time-consuming/error-prone/boring tasks, such as accessing the VS debugger.

It is technically "easy" to devolp mex files just inside of Matlab by itself... Then you dont need VS at all.

just dont make any single mistakes, and your life of mexing will be all happy, all the time :)

Comment only
29 Feb 2016 Tom Clark

@Igor and everyone else: With newer VS extensions, it's not too hard to make a configuration to build mex files for you now. Use mex -v option in MATLAB to see the libraries you have to include, then add those libraries to your build configuration in VS. Then build a dll, but specify the output file to have a .mexw64 extension rather than the usual .dll.
There are also a range of other options in MATLAB nowadays for simply accessing vanilla .dll file libraries, so maybe we're seeing a shift away from the need to build custom libraries at all (I hope so). Still, thanks for your efforts in supporting this over the years @Stefan!

Comment only
29 Feb 2016 Stefan Karlsson

Stefan Karlsson (view profile)

@Igor, and the world...

I am happy this has come to be useful. I will likely never develop this for a new version of Visual studio. Microsoft descided to remove support for Macros, which is what i based the first version of VSmex on. I then had to spend a week or more of work to convert my functions into a proper VS-addin project (I believe it was called). Then, with the next version of VS, all this changed again, with a reintroduction of macros. However, then MS decided to disable features necissary for me to develop this further.

These issues, together with a growing frustration about windows in general, has made leave that world behind. Thus i develop only on Linux these days.

If someone is willing to develop this further, perhaps as a github project, get in touch with me, and I can donate a little bit of time to share my experiences with this in getting you started. Contact me by email, through the service here at FEX.

Comment only
29 Dec 2015 Igor

Igor (view profile)

Great idea!

Any chance, that newer VS versions would be supported?

23 Nov 2015 Stefan Karlsson

Stefan Karlsson (view profile)

@Calum

Sorry for the late reply. You probably have a setting for building 32 bit applications by default, even though you are on 64 bit system.

If i remember correctly, then VS2010 comes shipped with two different versions of the debugger, one for 64, one for 32 bit.

I wont help you out unfortunately, because I no longer have a single computer with Windows, nor will I ever have one again. Best, Stefan

Comment only
27 Aug 2015 Calum

Calum (view profile)

This looks great. Unfortunately I get an error using the Debug function on 64 bit OS, any ideas? I'm using VS 2010 and Matlab 2013b, Windows 7 64 bit.

"The 32-bit version of Visual Studio Remote Debugging Monitor (MSVSMON.EXE) cannot be used to debug 64-bit processes"

Comment only
16 Dec 2014 Stefan Karlsson

Stefan Karlsson (view profile)

@jim

Thanks for your interest, and for sharing how you solved the issue. Sounds like it is a question of varying security settings, and thus nothing that I can do anything about. Great that the solution is so simple.

To reiterate:

Tools->Options->Addin/Macros Security

add the full path of the "Matlab Tools20xx.vsix" file.

Comment only
09 Dec 2014 Jim

Jim (view profile)

I use Matlab R2014B 64bit and VS2010 Pro under Windows XP Pro 64bit (SP2).

After following your instructions I had a slight difficulty in using the vsix plugin;
'View' worked ok, but the other commands 'Run','RunFast' and 'Debug' all reported 'No process is associated with this object'.

To fix this I needed to explicitly 'Add' the path to the 'vsix' plugin file to VisualStudio Tools->Options->Addin/Macros Security.

thanks

06 Mar 2014 Stefan Karlsson

Stefan Karlsson (view profile)

Thomas,

Thanks for your feedback. As this submission is all about avoiding boring stuff... I dont expect many people to give a rating or feedback on this submission.

Hope you find it useful, happy coding!

Comment only
04 Mar 2014 Thomas Clark

Used the VS2012 extension.

Works seamlessly, thank you very much.

It took me a long time to figure out how to do this for IFC on Linux, I wasn't relishing the process of working out the same thing on VS2012 for an entirely different platform!

21 Dec 2012 Stefan Karlsson

Stefan Karlsson (view profile)

videos here:
http://islab.hh.se/mediawiki/index.php/Stefan_Karlsson/PersonalPage/mex_VS_tutorial

Comment only
Updates
21 Dec 2012 1.1

Added the link to the videos

26 Dec 2012 1.4

- Only one open session of the thin matlab in the background.
- Added save check of current document

26 Dec 2012 1.3

Quick Fix previous upload.

26 Dec 2012 1.2

1. Added a macro "CompileWMatlab", which only compiles and builds the code in matlab.
2. Added remarks at the top of the VB file that details how to install the macros.
3. tidied up the example mex files

31 Dec 2013 1.5

There is now a visual studio extension, instead of just Macros. Simple click install for both VS 2010 and 2012

03 Mar 2014 1.6

updated the video tutorial

05 Oct 2014 1.7

Just changed the description to include VS 2012, which is fully supported

Contact us