From: Christopher on
"Pan " <chinryu(a)yahoo.com> wrote in message <hog2pi$kds$1(a)fred.mathworks.com>...
> Install MATLAB R2010a on Windows 7 X64 with Visual Studio 2008 + Windows SDK 7
>
> I try these command:
>
> >> mex -setup
> it's work (found VS2008) but cannot compile mexw64.
>
> >> mbuild -setup
> not work (VS2008 not found)
>
> Help me please

Hi Pan,

This thread might be related to your problem:
http://www.mathworks.com/matlabcentral/newsreader/view_thread/266328

I'm currently using R2009b on x64 Win7 with VS2008 and the Win SDK and I simply cannot get mex to work correctly. I keep getting the error:

'mt' is not recognized as an internal or external command,
operable program or batch file.

For instance, if I use the "timestwo.c" example, I get:
>> mex -v timestwo.c

This is mex, Copyright 1984-2007 The MathWorks, Inc.

-> Default options filename found in C:\Users\Chris\AppData\Roaming\MathWorks\MATLAB\R2009b
----------------------------------------------------------------
-> Options file = C:\Users\Chris\AppData\Roaming\MathWorks\MATLAB\R2009b\mexopts.bat
MATLAB = C:\PROGRA~1\MATLAB\R2009B
-> COMPILER = cl
-> Compiler flags:
COMPFLAGS = /c /Zp8 /GR /W3 /EHs /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_SECURE_SCL=0 /DMATLAB_MEX_FILE /nologo /MD
OPTIMFLAGS = /O2 /Oy- /DNDEBUG
DEBUGFLAGS = /Z7
arguments =
Name switch = /Fo
-> Pre-linking commands =
-> LINKER = link
-> Link directives:
LINKFLAGS = /dll /export:mexFunction /LIBPATH:"C:\PROGRA~1\MATLAB\R2009B\extern\lib\win64\microsoft" libmx.lib libmex.lib libmat.lib /MACHINE:X64 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /incremental:NO /implib:"C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_ZK~1\templib.x" /MAP:"timestwo.mexw64.map"
LINKDEBUGFLAGS = /DEBUG /PDB:"timestwo.mexw64.pdb"
LINKFLAGSPOST =
Name directive = /out:"timestwo.mexw64"
File link directive =
Lib. link directive =
Rsp file indicator = @
-> Resource Compiler = rc /fo "mexversion.res"
-> Resource Linker =
----------------------------------------------------------------


--> cl /c /Zp8 /GR /W3 /EHs /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_SECURE_SCL=0 /DMATLAB_MEX_FILE /nologo /MD /FoC:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_ZK~1\timestwo.obj -IC:\PROGRA~1\MATLAB\R2009B\extern\include -IC:\PROGRA~1\MATLAB\R2009B\simulink\include /O2 /Oy- /DNDEBUG -DMX_COMPAT_32 timestwo.c

timestwo.c
timestwo.c(33) : warning C4267: '=' : conversion from 'size_t' to 'mwSize', possible loss of data
timestwo.c(34) : warning C4267: '=' : conversion from 'size_t' to 'mwSize', possible loss of data
Contents of C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_ZK~1\mex_tmp.rsp:
C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_ZK~1\timestwo.obj


--> link /out:"timestwo.mexw64" /dll /export:mexFunction /LIBPATH:"C:\PROGRA~1\MATLAB\R2009B\extern\lib\win64\microsoft" libmx.lib libmex.lib libmat.lib /MACHINE:X64 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /incremental:NO /implib:"C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_ZK~1\templib.x" /MAP:"timestwo.mexw64.map" @C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_ZK~1\MEX_TMP.RSP

Creating library C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_ZK~1\templib.x and object C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_ZK~1\templib.exp

--> del "C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_ZK~1\templib.x" "C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_ZK~1\templib.exp"


--> mt -outputresource:"timestwo.mexw64;2" -manifest "timestwo.mexw64.manifest"

'mt' is not recognized as an internal or external command,
operable program or batch file.

--> del "timestwo.mexw64.manifest"


--> del "timestwo.mexw64.map"

Do you have a similar problem? I've read that 'mt' is for multi-threading (I have a Core i7 laptop).

Chris