Set PATH = %VCINSTALLDIR%\bin\amd64 %VCINSTALLDIR%\bin %VCINSTALLDIR%\VCPackages %VSINSTALLDIR%\Common7\IDE %VSINSTALLDIR%\Common7\Tools %LINKERDIR%\bin\圆4 %LINKERDIR%\bin %MATLAB_BIN% %PATH%
Set LINKERDIR ='.registry_lookup( "SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.1A ", "InstallationFolder ").' Rem In this case, LINKERDIR is being used to specify the location of the SDK Rem C++keyName: Microsoft Visual C++ 2010 Rem Copyright 2007-2009 The MathWorks, Inc. Rem using the Microsoft Visual C++ compiler version 10.0 Rem Compile and link options used for building MEX-files REM It is based on msvc100opts.bat, but please ignore "VC2010" or whatever REM Put it into `%USERPROFILE%\AppData\Roaming\MathWorks\MATLAB\R2010b`. Just copy it to the directory and it might work. Run mex -v somecode.cpp and xw64 will be built.Īttached is the mexopts.bat file. Set PATH=%VSINSTALLDIR%\VC\bin\x86_amd64 %PATH% Set LINKERDIR='.registry_lookup("SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.1A", "InstallationFolder").' Now create a soft link in command window (admin): mklink /D VC11 "D:\Program Files (x86)\Microsoft Visual Studio 11.0"Įdit mexopts.bat - add/update the following 3 lines: set VSINSTALLDIR=D:\!\Path\VC11 Make a new folder named D:\!\Path and add it to the %PATH% environment variable Since the long path with space C:\Program Files\. %USERPROFILE%\AppData\Roaming\MathWorks\MATLAB\R2010b\mexopts.bat Manually copy %MATLAB%\R2010b\bin\win64\mexopts\msvc100opts.bat to Surprisingly, when I checked the path it seemed SDK 7.1 had already been installed: C:\Program Files (x86)\Microsoft SDKs\Windows>dir /B Would you like mex to locate installed compilers /n? yĪnd there existed no mexopts.bat in %USERPROFILE%\AppData\Roaming\MathWorks\MATLAB\R2010b.Īccording to some posts ( this one for example) on Matlab Answers, Please choose your compiler for building external interface (MEX) files: Here is the note for how I configured Matlab to build mex C/C++ extensions on 64-bit Windows 8:Īt first, mex failed to find a compiler: > mex -setup
#Matlab 2012 windows 8 windows 8#
mexw64 by cl.exe from VS 2012 Express for Desktop & Matlab 2010b on 64-bit Windows 8