Changes between Version 2 and Version 3 of howto/MEX_Compile


Ignore:
Timestamp:
Aug 26, 2013, 10:32:48 AM (11 years ago)
Author:
welsh
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • howto/MEX_Compile

    v2 v3  
    1212NOTE:  These steps were completed on a Windows 7 Professional 64-bit system.  There may be some variances for other versions of Windows.  If you find any discrepancies, please let us know.
    1313
    14 === Installing Microsoft Visual Studio ===
     14=== Installing Microsoft Visual C++ Express 2010 and Windows SDK ===
    1515
    16 TBD
     16In order to compile MEX, we recommend installing [http://www.microsoft.com/visualstudio/eng/products/visual-studio-2010-express Microsoft Visual C++ Express 2010] (This tutorial should work with Microsoft Visual C++ Express 2012 but might have minor differences) and the [http://www.microsoft.com/en-us/download/details.aspx?id=8279 Windows SDK (version 7.1)].  For additional tool installations, please refer to the [wiki:GettingStarted/WARPv3/Tools Recommended Tools for WARP v3].
     17
     18Please follow the procedures from Microsoft for downloading and installing Microsoft Visual C++ Express 2010 and the Windows SDK.
     19
     20One common error that we have seen is //Return Code 5100//.  This indicates that there were existing installs of redistributable Microsoft Visual C++ (for example, MATLAB will install a redistributable Microsoft Visual C++ program as part of its install) and that the installation could not proceed.  In that case, you need to uninstall existing Visual C++ redistributable installations.  You can see a good summary of the solution:
     21
     22http://stackoverflow.com/questions/1901279/windows-7-sdk-installation-failure
     23
     24For example, you can see that on one of our machines, there are many distributions of Microsoft Visual C++ installed on the computer as part of installs from other programs (see "Control Panel" -> "Programs and Features"):
     25
     26[[Image(Tool_Install_Issue_Add_Remove_Programs.PNG, 700px)]]
     27
     28which can lead to issues when trying to install the Windows SDK.
     29
    1730
    1831=== Setting up the Matlab environment for compiling MEX ===
     
    144157[[Image(MEX_Debug_Attach.png, 600px)]]
    145158
    146 Once you attach to the process, you should then be able to debug your code (ie set breakpoints, etc) using the standard Visual C++ Express 2010 methods.  For example, once you have set a breakpoint, then you can run your code within MATLAB and have the program halt at the breakpoint to see the various variables and other watchpoints:
     159Once you attach to the process, you should then be able to debug your code (ie set breakpoints, etc) using the standard Visual C++ Express 2010 methods.  [[BR]]
     160
     161For example, once you have set a breakpoint, then you can run your code within MATLAB and have the program halt at the breakpoint to see the various variables and other watchpoints:
    147162
    148163[[Image(MEX_Debug_Breakpoint.png, 600px)]]