Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
R2009b Visual Studio 2008 / Win7 x64

Subject: R2009b Visual Studio 2008 / Win7 x64

From: David Izhaky

Date: 19 Nov, 2009 15:33:20

Message: 1 of 25

I installed Visual Studio 2008 Express in my Win7 x64 and cannot get the compiler to compile a mex file. I tried all suggestions here and other places, and still it does not work. I also installed the trial version of Visual Studio 2008.

This is the error I am getting after configuring mex:

 Error: Could not find the 64-bit compiler. This may indicate that the
         "X64 Compilers and Tools" or the Microsoft Windows Software
         Development Kit (SDK) is not installed. To build 64-bit MEX-files
         Microsoft Visual C++ 2008 requires that these two packages are
         installed properly.

and this is the error I am getting when execute mex yprime.c

Error: Could not find the compiler "cl" on the DOS path.
         Use mex -setup to configure your environment properly.
 
 
  C:\PROGRA~1\MATLAB\R2009B\BIN\MEX.PL: Error: Unable to locate compiler.
 
??? Error using ==> mex at 221
Unable to complete successfully.

Subject: R2009b Visual Studio 2008 / Win7 x64

From: Arnaud Miege

Date: 19 Nov, 2009 15:41:39

Message: 2 of 25


"David Izhaky" <david@opt-imaging.com> wrote in message
news:he3og0$8au$1@fred.mathworks.com...
>I installed Visual Studio 2008 Express in my Win7 x64 and cannot get the
>compiler to compile a mex file. I tried all suggestions here and other
>places, and still it does not work. I also installed the trial version of
>Visual Studio 2008.
>
> This is the error I am getting after configuring mex:
>
> Error: Could not find the 64-bit compiler. This may indicate that the
> "X64 Compilers and Tools" or the Microsoft Windows Software
> Development Kit (SDK) is not installed. To build 64-bit MEX-files
> Microsoft Visual C++ 2008 requires that these two packages are
> installed properly.
>
> and this is the error I am getting when execute mex yprime.c
>
> Error: Could not find the compiler "cl" on the DOS path.
> Use mex -setup to configure your environment properly.
>
>
> C:\PROGRA~1\MATLAB\R2009B\BIN\MEX.PL: Error: Unable to locate compiler.
>
> ??? Error using ==> mex at 221
> Unable to complete successfully.
>

As the error message suggests, you need to select "X64 Compilers and Tools"
when installing Microsoft Visual Studio. This is not selected by default.
Have a look at the following for more info:

http://www.mathworks.com/support/compilers/R2009b/win64.html

HTH,

Arnaud

Subject: R2009b Visual Studio 2008 / Win7 x64

From: David Izhaky

Date: 19 Nov, 2009 15:47:20

Message: 3 of 25

>
> As the error message suggests, you need to select "X64 Compilers and Tools"
> when installing Microsoft Visual Studio. This is not selected by default.
> Have a look at the following for more info:
>
> http://www.mathworks.com/support/compilers/R2009b/win64.html
>
> HTH,
>
> Arnaud
>
This option does not exist in either Visual Studio 2008 express or visual studio 2008 trial! Also, it does not exist in the Windows 7 SDK .net 3.5 that I installed before. It will be nice if Mathworks engineer would reverify that.

Subject: R2009b Visual Studio 2008 / Win7 x64

From: Arnaud Miege

Date: 19 Nov, 2009 15:51:56

Message: 4 of 25


"David Izhaky" <david@opt-imaging.com> wrote in message
news:he3pa8$h9$1@fred.mathworks.com...
>>
>> As the error message suggests, you need to select "X64 Compilers and
>> Tools"
>> when installing Microsoft Visual Studio. This is not selected by default.
>> Have a look at the following for more info:
>>
>> http://www.mathworks.com/support/compilers/R2009b/win64.html
>>
>> HTH,
>>
>> Arnaud
>>
> This option does not exist in either Visual Studio 2008 express or visual
> studio 2008 trial! Also, it does not exist in the Windows 7 SDK .net 3.5
> that I installed before. It will be nice if Mathworks engineer would
> reverify that.
>

Did you actually look at the page I mentioned, in particular note 6, which
should point you to the following solution?
http://www.mathworks.com/support/solutions/en/data/1-6IJJ3L/index.html?solution=1-6IJJ3L

Arnaud

Subject: R2009b Visual Studio 2008 / Win7 x64

From: DJ_Jones

Date: 20 Nov, 2009 09:45:21

Message: 5 of 25

On Nov 19, 5:51 pm, "Arnaud Miege"
<arnaud.mi...@nospam.mathworks.co.uk> wrote:
> "David Izhaky" <da...@opt-imaging.com> wrote in message
>
> news:he3pa8$h9$1@fred.mathworks.com...
>
>
>
>
>
>
>
> >> As the error message suggests, you need to select "X64 Compilers and
> >> Tools"
> >> when installing Microsoft Visual Studio. This is not selected by default.
> >> Have a look at the following for more info:
>
> >>http://www.mathworks.com/support/compilers/R2009b/win64.html
>
> >> HTH,
>
> >> Arnaud
>
> > This option does not exist in either Visual Studio 2008 express or visual
> > studio 2008 trial! Also, it does not exist in the Windows 7 SDK .net 3.5
> > that I installed before. It will be nice if Mathworks engineer would
> > reverify that.
>
> Did you actually look at the page I mentioned, in particular note 6, which
> should point you to the following solution?http://www.mathworks.com/support/solutions/en/data/1-6IJJ3L/index.htm...
>
> Arnaud- Hide quoted text -
>
> - Show quoted text -

I got the same problem here. Win7 x64, You do not have those options
mention in the page http://www.mathworks.com/support/solutions/en/data/1-6IJJ3L/index.htm

I installed Visual Studio 2008 Express and Visual Studio 2008 Full
including the Win 7 SDK and the amd64 folder does not exist. It looks
like Mathworks engineers did not test R2009b on Win7 for all options.

Subject: R2009b Visual Studio 2008 / Win7 x64

From: David Izhaky

Date: 23 Nov, 2009 07:40:18

Message: 6 of 25

> I installed Visual Studio 2008 Express and Visual Studio 2008 Full
> including the Win 7 SDK and the amd64 folder does not exist. It looks
> like Mathworks engineers did not test R2009b on Win7 for all options.

So, I am not the only one that experiences this problem. It will be nice if a Mathworks engineer will fix those issues.

Subject: R2009b Visual Studio 2008 / Win7 x64

From: Arnaud Miege

Date: 23 Nov, 2009 10:21:20

Message: 7 of 25


"David Izhaky" <david@opt-imaging.com> wrote in message
news:hede92$6os$1@fred.mathworks.com...
>> I installed Visual Studio 2008 Express and Visual Studio 2008 Full
>> including the Win 7 SDK and the amd64 folder does not exist. It looks
>> like Mathworks engineers did not test R2009b on Win7 for all options.
>
> So, I am not the only one that experiences this problem. It will be nice
> if a Mathworks engineer will fix those issues.
>

There is no issue to fix, you need to install the correct components for
Visual Studio to work.

Arnaud

Subject: R2009b Visual Studio 2008 / Win7 x64

From: Anthony Weathers

Date: 9 Dec, 2009 09:16:02

Message: 8 of 25

"Arnaud Miege" <arnaud.miege@nospam.mathworks.co.uk> wrote in message <hednn0$qtb$1@fred.mathworks.com>...
>
> "David Izhaky" <david@opt-imaging.com> wrote in message
> news:hede92$6os$1@fred.mathworks.com...
> >> I installed Visual Studio 2008 Express and Visual Studio 2008 Full
> >> including the Win 7 SDK and the amd64 folder does not exist. It looks
> >> like Mathworks engineers did not test R2009b on Win7 for all options.
> >
> > So, I am not the only one that experiences this problem. It will be nice
> > if a Mathworks engineer will fix those issues.
> >
>
> There is no issue to fix, you need to install the correct components for
> Visual Studio to work.
>
> Arnaud
>

Actually, there is an issue to fix, but who's issue is the question. For those who have selected to install the x64 compilers, it is in the following directory in Win7 (C:\Program Files (x86)\Microsoft Visual xxxx\VC). So the issue, it seems, is that Matlab will not look in the x86 Program Files folder for the x64 compilers. I have the same issue, and I know for a fact the compilers are on the computer.

We just need a way to point Matlab to the x86 directory, or possibly try installing the compilers in the x64 Program Files directory.

Subject: R2009b Visual Studio 2008 / Win7 x64

From: Arnaud Miege

Date: 9 Dec, 2009 11:27:45

Message: 9 of 25


"Anthony Weathers" <anthony.weathers@us.army.mil> wrote in message
news:hfnpsi$n5f$1@fred.mathworks.com...

>>
>
> Actually, there is an issue to fix, but who's issue is the question. For
> those who have selected to install the x64 compilers, it is in the
> following directory in Win7 (C:\Program Files (x86)\Microsoft Visual
> xxxx\VC). So the issue, it seems, is that Matlab will not look in the x86
> Program Files folder for the x64 compilers. I have the same issue, and I
> know for a fact the compilers are on the computer.
>
> We just need a way to point Matlab to the x86 directory, or possibly try
> installing the compilers in the x64 Program Files directory.
>

Thanks for pointing this out. Can you report it here?
http://www.mathworks.com/support/bugreports/

Thanks again,

Arnaud

Subject: R2009b Visual Studio 2008 / Win7 x64

From: Anthony Weathers

Date: 9 Dec, 2009 16:43:22

Message: 10 of 25

"Arnaud Miege" <arnaud.miege@nospam.mathworks.co.uk> wrote in message <hfo1ji$arr$1@fred.mathworks.com>...

>
> Thanks for pointing this out. Can you report it here?
> http://www.mathworks.com/support/bugreports/
>
> Thanks again,
>
> Arnaud
>

Sure, in the mean time, I found this...

http://www.mathworks.com/matlabcentral/fileexchange/18508-microsoft-visual-studio-2008-mex-and-mbuild-setup-files

Download the files, then place the appropriate x64 files (both mex and mbuild) in the directories listed in the .txt file, then run mbuild -setup again. For me, this detected the x64 compiler. I have not tried compiling anything so I can't verify that it works, and the comments seem to be mixed....but it's a start.

Anthony

Subject: R2009b Visual Studio 2008 / Win7 x64

From: Christopher

Date: 5 May, 2010 14:31:20

Message: 11 of 25

"Arnaud Miege" <arnaud.miege@nospam.mathworks.co.uk> wrote in message <hednn0$qtb$1@fred.mathworks.com>...
>
> "David Izhaky" <david@opt-imaging.com> wrote in message
> news:hede92$6os$1@fred.mathworks.com...
> >> I installed Visual Studio 2008 Express and Visual Studio 2008 Full
> >> including the Win 7 SDK and the amd64 folder does not exist. It looks
> >> like Mathworks engineers did not test R2009b on Win7 for all options.
> >
> > So, I am not the only one that experiences this problem. It will be nice
> > if a Mathworks engineer will fix those issues.
> >
>
> There is no issue to fix, you need to install the correct components for
> Visual Studio to work.
>
> Arnaud
>

Hi Arnaud,

I have a Win7 x64 machine running R2009b and I have the same problem. On the supported compilers page, we are greeted with this footnote:

"To use Microsoft Visual Studio with MATLAB on a 64-bit platform, you must select "X64 Compilers and Tools" when installing Microsoft Visual Studio. This is not selected by default. Microsoft Visual Studio 2008 Express and Professional Editions also require that the Microsoft Windows Software Development Kit (SDK) is installed properly. For more information, see Solution 1-6IJJ3L."

Now, this is misleading, since there is no option to select "x64 Compilers and Tools" when installing *VS*, at least from my experience - only options to install Silverlight and something for SQL.

At first, I had just installed VS and then tried using >> mex -setup again to receive the same error (that MATLAB cannot find the x64 compiler). Then, I read the solution page (1-6IJJ3L)

http://www.mathworks.com/support/solutions/en/data/1-6IJJ3L/index.html?solution=1-6IJJ3L

So, I installed the MS SDK today. During the installation of the SDK, I was able to select Visual C++ Compilers, which included the x64 compliers (so, the option to install x64 compilers comes with the installation of the SDK, not VS!). During this process I installed the options:
Developer Tools > Visual C++ Compilers
and
Developer Tools > Windows Headers and Libraries

Unfortunately, after doing this, I still can't get MATLAB to find the x64 compilers. Also, the SDK appears to have installed correctly, as the following file appears as wanted (see the solution page).

C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\amd64\cl.exe

So, I'm not sure what to do at this point.
Chris

Subject: R2009b Visual Studio 2008 / Win7 x64

From: Christopher

Date: 5 May, 2010 15:19:05

Message: 12 of 25

"David Izhaky" <david@opt-imaging.com> wrote in message <he3og0$8au$1@fred.mathworks.com>...
> I installed Visual Studio 2008 Express in my Win7 x64 and cannot get the compiler to compile a mex file. I tried all suggestions here and other places, and still it does not work. I also installed the trial version of Visual Studio 2008.
>
> This is the error I am getting after configuring mex:
>
> Error: Could not find the 64-bit compiler. This may indicate that the
> "X64 Compilers and Tools" or the Microsoft Windows Software
> Development Kit (SDK) is not installed. To build 64-bit MEX-files
> Microsoft Visual C++ 2008 requires that these two packages are
> installed properly.
>
> and this is the error I am getting when execute mex yprime.c
>
> Error: Could not find the compiler "cl" on the DOS path.
> Use mex -setup to configure your environment properly.
>
>
> C:\PROGRA~1\MATLAB\R2009B\BIN\MEX.PL: Error: Unable to locate compiler.
>
> ??? Error using ==> mex at 221
> Unable to complete successfully.

Sorry for the quick double-post on this subject, but I found something interesting.

Previously, I had installed MS Visual Studio 2008 first, then the SDK, as described here:
http://www.mathworks.com/support/solutions/en/data/1-6IJJ3L/index.html?solution=1-6IJJ3L

However, MATLAB was still unable to find the x64 compiler.

Then, today, I reinstalled MS VS, or rather, I ran the setup again and "repaired" the installation. To my surprise, it appeared that more x64 options were being installed than before. Perhaps this installation recognized the MS SDK installation and decided to install more x64 stuff on its own. Also to my surprise, MATLAB afterwards found the x64 compiler. Does the SDK (only Developer Tools > Visual C++ Compilers) need to be installed *before* Visual Studio?

At any rate, at least the Simulink Accelerator appears to be working now. Unfortunately, I'm having trouble using Embedded MATLAB blocks in Simulink and I cannot run mex on the example in the solution page above. When I run the following code:

copyfile(fullfile(matlabroot,'extern','examples','mex','yprime.c'))
mex -v yprime.c
yprime(1,1:4)

I get at the output:

 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_LY~1\templib.x" /MAP:"yprime.mexw64.map"
         LINKDEBUGFLAGS = /DEBUG /PDB:"yprime.mexw64.pdb"
         LINKFLAGSPOST =
         Name directive = /out:"yprime.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_LY~1\yprime.obj -IC:\PROGRA~1\MATLAB\R2009B\extern\include -IC:\PROGRA~1\MATLAB\R2009B\simulink\include /O2 /Oy- /DNDEBUG -DMX_COMPAT_32 yprime.c
 
yprime.c
yprime.c(85) : warning C4267: '=' : conversion from 'size_t' to 'mwSize', possible loss of data
yprime.c(86) : warning C4267: '=' : conversion from 'size_t' to 'mwSize', possible loss of data
    Contents of C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_LY~1\mex_tmp.rsp:
  C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_LY~1\yprime.obj
 
 
--> link /out:"yprime.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_LY~1\templib.x" /MAP:"yprime.mexw64.map" @C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_LY~1\MEX_TMP.RSP
 
   Creating library C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_LY~1\templib.x and object C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_LY~1\templib.exp
 
--> del "C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_LY~1\templib.x" "C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_LY~1\templib.exp"
 
 
--> mt -outputresource:"yprime.mexw64;2" -manifest "yprime.mexw64.manifest"
 
'mt' is not recognized as an internal or external command,
operable program or batch file.
 
--> del "yprime.mexw64.manifest"
 
 
--> del "yprime.mexw64.map"
 
??? Invalid MEX-file 'C:\cygwin\home\Chris\research\rotations\so3\simulation\yprime.mexw64': The specified module could not be found.


Unfortunately, a search on this error yielded only the following page:
http://www.mathworks.com/matlabcentral/newsreader/view_thread/166600

I will see if I can get MATLAB to find 'mt' as well.

Subject: R2009b Visual Studio 2008 / Win7 x64

From: Christopher

Date: 5 May, 2010 16:02:05

Message: 13 of 25

For further documentation, when I try to use Embedded MATLAB, I get the following error when I click the 'Build' button from an Embedded MATLAB block:

Embedded MATLAB Interface Error: Error calling generated SFunction, attitude_control_sfun

Sometimes, if I try to run the simulation (after the build fails, with the error dialog still open), it will produce the following error:

Making simulation target "attitude_control_sfun", ...


 
C:\cygwin\home\Chris\research\rotations\so3\simulation\slprj\_sfprj\attitude_control\_self\sfun\src>call "mexopts.bat"
 
Microsoft (R) Program Maintenance Utility Version 9.00.30729.01
Copyright (C) Microsoft Corporation. All rights reserved.
 
### Compiling "attitude_control_sfun.c"
cl.exe /c /Zp8 /GR /W3 /EHs /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_SECURE_SCL=0 /DMATLAB_MEX_FILE /nologo /MD /MD /I "c:\program files\matlab\r2009b\extern\include" /I "c:\program files\matlab\r2009b\simulink\include" /I "c:\program files\matlab\r2009b\stateflow\c\mex\include" /I "c:\program files\matlab\r2009b\stateflow\c\debugger\include" "attitude_control_sfun.c"
attitude_control_sfun.c
attitude_control_sfun.c(7) : fatal error C1083: Cannot open include file: 'c5_attitude_control.h': No such file or directory
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\amd64\cl.exe"' : return code '0x2'
Stop.

This error seems to have something in common with the post
http://www.mathworks.com/matlabcentral/newsreader/view_thread/270052
where the author is also having problems running MATLAB on x64 Win7.
 

Subject: R2009b Visual Studio 2008 / Win7 x64

From: Iulian

Date: 25 May, 2010 18:03:21

Message: 14 of 25

"Christopher " <christopher.mayhew@gmail.com> wrote in message <hrs299$8n5$1@fred.mathworks.com>...
> "David Izhaky" <david@opt-imaging.com> wrote in message <he3og0$8au$1@fred.mathworks.com>...
> > I installed Visual Studio 2008 Express in my Win7 x64 and cannot get the compiler to compile a mex file. I tried all suggestions here and other places, and still it does not work. I also installed the trial version of Visual Studio 2008.
> >
> > This is the error I am getting after configuring mex:
> >
> > Error: Could not find the 64-bit compiler. This may indicate that the
> > "X64 Compilers and Tools" or the Microsoft Windows Software
> > Development Kit (SDK) is not installed. To build 64-bit MEX-files
> > Microsoft Visual C++ 2008 requires that these two packages are
> > installed properly.
> >
> > and this is the error I am getting when execute mex yprime.c
> >
> > Error: Could not find the compiler "cl" on the DOS path.
> > Use mex -setup to configure your environment properly.
> >
> >
> > C:\PROGRA~1\MATLAB\R2009B\BIN\MEX.PL: Error: Unable to locate compiler.
> >
> > ??? Error using ==> mex at 221
> > Unable to complete successfully.
>
> Sorry for the quick double-post on this subject, but I found something interesting.
>
> Previously, I had installed MS Visual Studio 2008 first, then the SDK, as described here:
> http://www.mathworks.com/support/solutions/en/data/1-6IJJ3L/index.html?solution=1-6IJJ3L
>
> However, MATLAB was still unable to find the x64 compiler.
>
> Then, today, I reinstalled MS VS, or rather, I ran the setup again and "repaired" the installation. To my surprise, it appeared that more x64 options were being installed than before. Perhaps this installation recognized the MS SDK installation and decided to install more x64 stuff on its own. Also to my surprise, MATLAB afterwards found the x64 compiler. Does the SDK (only Developer Tools > Visual C++ Compilers) need to be installed *before* Visual Studio?
>
> At any rate, at least the Simulink Accelerator appears to be working now. Unfortunately, I'm having trouble using Embedded MATLAB blocks in Simulink and I cannot run mex on the example in the solution page above. When I run the following code:
>
> copyfile(fullfile(matlabroot,'extern','examples','mex','yprime.c'))
> mex -v yprime.c
> yprime(1,1:4)
>
> I get at the output:
>
> 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_LY~1\templib.x" /MAP:"yprime.mexw64.map"
> LINKDEBUGFLAGS = /DEBUG /PDB:"yprime.mexw64.pdb"
> LINKFLAGSPOST =
> Name directive = /out:"yprime.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_LY~1\yprime.obj -IC:\PROGRA~1\MATLAB\R2009B\extern\include -IC:\PROGRA~1\MATLAB\R2009B\simulink\include /O2 /Oy- /DNDEBUG -DMX_COMPAT_32 yprime.c
>
> yprime.c
> yprime.c(85) : warning C4267: '=' : conversion from 'size_t' to 'mwSize', possible loss of data
> yprime.c(86) : warning C4267: '=' : conversion from 'size_t' to 'mwSize', possible loss of data
> Contents of C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_LY~1\mex_tmp.rsp:
> C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_LY~1\yprime.obj
>
>
> --> link /out:"yprime.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_LY~1\templib.x" /MAP:"yprime.mexw64.map" @C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_LY~1\MEX_TMP.RSP
>
> Creating library C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_LY~1\templib.x and object C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_LY~1\templib.exp
>
> --> del "C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_LY~1\templib.x" "C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_LY~1\templib.exp"
>
>
> --> mt -outputresource:"yprime.mexw64;2" -manifest "yprime.mexw64.manifest"
>
> 'mt' is not recognized as an internal or external command,
> operable program or batch file.
>
> --> del "yprime.mexw64.manifest"
>
>
> --> del "yprime.mexw64.map"
>
> ??? Invalid MEX-file 'C:\cygwin\home\Chris\research\rotations\so3\simulation\yprime.mexw64': The specified module could not be found.
>
>
> Unfortunately, a search on this error yielded only the following page:
> http://www.mathworks.com/matlabcentral/newsreader/view_thread/166600
>
> I will see if I can get MATLAB to find 'mt' as well.

Hello,

I had the same problem. It seems that "Microsoft Windows SDK for Windows 7 and .NET Framework 4" released in May 2010 have a bug : the mexopts.bat file is not correctly generated . I uninstall this version and install "Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 Service Pack 1" from that link http://www.microsoft.com/downloads/details.aspx?FamilyID=c17ba869-9671-4330-a63e-1fd44e0e2505&displaylang=en . If it still doesn't work, I can send you my mexopts.bat file. I tested on two different PC ( Windows 7 64 bit) and works very good.
Please let me know if this solves your problem.

Best regards,
Iulian

Subject: R2009b Visual Studio 2008 / Win7 x64

From: Mustafa

Date: 3 Jun, 2010 15:03:06

Message: 15 of 25

"Christopher " <christopher.mayhew@gmail.com> wrote in message <hrs299$8n5$1@fred.mathworks.com>...
> "David Izhaky" <david@opt-imaging.com> wrote in message <he3og0$8au$1@fred.mathworks.com>...
> > I installed Visual Studio 2008 Express in my Win7 x64 and cannot get the compiler to compile a mex file. I tried all suggestions here and other places, and still it does not work. I also installed the trial version of Visual Studio 2008.
> >
> > This is the error I am getting after configuring mex:
> >
> > Error: Could not find the 64-bit compiler. This may indicate that the
> > "X64 Compilers and Tools" or the Microsoft Windows Software
> > Development Kit (SDK) is not installed. To build 64-bit MEX-files
> > Microsoft Visual C++ 2008 requires that these two packages are
> > installed properly.
> >
> > and this is the error I am getting when execute mex yprime.c
> >
> > Error: Could not find the compiler "cl" on the DOS path.
> > Use mex -setup to configure your environment properly.
> >
> >
> > C:\PROGRA~1\MATLAB\R2009B\BIN\MEX.PL: Error: Unable to locate compiler.
> >
> > ??? Error using ==> mex at 221
> > Unable to complete successfully.
>
> Sorry for the quick double-post on this subject, but I found something interesting.
>
> Previously, I had installed MS Visual Studio 2008 first, then the SDK, as described here:
> http://www.mathworks.com/support/solutions/en/data/1-6IJJ3L/index.html?solution=1-6IJJ3L
>
> However, MATLAB was still unable to find the x64 compiler.
>
> Then, today, I reinstalled MS VS, or rather, I ran the setup again and "repaired" the installation. To my surprise, it appeared that more x64 options were being installed than before. Perhaps this installation recognized the MS SDK installation and decided to install more x64 stuff on its own. Also to my surprise, MATLAB afterwards found the x64 compiler. Does the SDK (only Developer Tools > Visual C++ Compilers) need to be installed *before* Visual Studio?
>
> At any rate, at least the Simulink Accelerator appears to be working now. Unfortunately, I'm having trouble using Embedded MATLAB blocks in Simulink and I cannot run mex on the example in the solution page above. When I run the following code:
>
> copyfile(fullfile(matlabroot,'extern','examples','mex','yprime.c'))
> mex -v yprime.c
> yprime(1,1:4)
>
> I get at the output:
>
> 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_LY~1\templib.x" /MAP:"yprime.mexw64.map"
> LINKDEBUGFLAGS = /DEBUG /PDB:"yprime.mexw64.pdb"
> LINKFLAGSPOST =
> Name directive = /out:"yprime.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_LY~1\yprime.obj -IC:\PROGRA~1\MATLAB\R2009B\extern\include -IC:\PROGRA~1\MATLAB\R2009B\simulink\include /O2 /Oy- /DNDEBUG -DMX_COMPAT_32 yprime.c
>
> yprime.c
> yprime.c(85) : warning C4267: '=' : conversion from 'size_t' to 'mwSize', possible loss of data
> yprime.c(86) : warning C4267: '=' : conversion from 'size_t' to 'mwSize', possible loss of data
> Contents of C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_LY~1\mex_tmp.rsp:
> C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_LY~1\yprime.obj
>
>
> --> link /out:"yprime.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_LY~1\templib.x" /MAP:"yprime.mexw64.map" @C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_LY~1\MEX_TMP.RSP
>
> Creating library C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_LY~1\templib.x and object C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_LY~1\templib.exp
>
> --> del "C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_LY~1\templib.x" "C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_LY~1\templib.exp"
>
>
> --> mt -outputresource:"yprime.mexw64;2" -manifest "yprime.mexw64.manifest"
>
> 'mt' is not recognized as an internal or external command,
> operable program or batch file.
>
> --> del "yprime.mexw64.manifest"
>
>
> --> del "yprime.mexw64.map"
>
> ??? Invalid MEX-file 'C:\cygwin\home\Chris\research\rotations\so3\simulation\yprime.mexw64': The specified module could not be found.
>
>
> Unfortunately, a search on this error yielded only the following page:
> http://www.mathworks.com/matlabcentral/newsreader/view_thread/166600
>
> I will see if I can get MATLAB to find 'mt' as well.


Chris,

I had a very similar problem (ie after installation mt.exe was not recognized).

Solution is to install the developer tools in SDK as well. As far as I can tell, you did not choose to install the developer tools so you do not get mt.exe in your SDK installation.

I hope this helps

Subject: R2009b Visual Studio 2008 / Win7 x64

From: Christopher

Date: 4 Jun, 2010 17:00:29

Message: 16 of 25

"Mustafa " <dokucu@ge.com> wrote in message <hu8g7a$aol$1@fred.mathworks.com>...
> Chris,
>
> I had a very similar problem (ie after installation mt.exe was not recognized).
>
> Solution is to install the developer tools in SDK as well. As far as I can tell, you did not choose to install the developer tools so you do not get mt.exe in your SDK installation.
>
> I hope this helps

Hi Mustafa,

As you might see from my post above (Date: 5 May, 2010 14:31:20, Message: 11 of 15), I installed
Developer Tools > Visual C++ Compilers
and
Developer Tools > Windows Headers and Libraries
from the SDK, which apparently inclues mt.exe (maybe just the VC++ compilers?)

As it turns out, the response above yours, (From: Iulian, Date: 25 May, 2010 18:03:21, Message: 14 of 15) seems to be the right respose - my mexopts.bat file was not being generated properly. Instead, I was able to solve the problem using the solution posted on
http://www.mathworks.com/matlabcentral/fileexchange/22689),
after hacking around with it a little bit.

Subject: R2009b Visual Studio 2008 / Win7 x64

From: Mustafa

Date: 7 Jun, 2010 12:37:04

Message: 17 of 25

"Christopher " <christopher.mayhew@gmail.com> wrote in message <hubbfd$lhs$1@fred.mathworks.com>...
> "Mustafa " <dokucu@ge.com> wrote in message <hu8g7a$aol$1@fred.mathworks.com>...
> > Chris,
> >
> > I had a very similar problem (ie after installation mt.exe was not recognized).
> >
> > Solution is to install the developer tools in SDK as well. As far as I can tell, you did not choose to install the developer tools so you do not get mt.exe in your SDK installation.
> >
> > I hope this helps
>
> Hi Mustafa,
>
> As you might see from my post above (Date: 5 May, 2010 14:31:20, Message: 11 of 15), I installed
> Developer Tools > Visual C++ Compilers
> and
> Developer Tools > Windows Headers and Libraries
> from the SDK, which apparently inclues mt.exe (maybe just the VC++ compilers?)
>
> As it turns out, the response above yours, (From: Iulian, Date: 25 May, 2010 18:03:21, Message: 14 of 15) seems to be the right respose - my mexopts.bat file was not being generated properly. Instead, I was able to solve the problem using the solution posted on
> http://www.mathworks.com/matlabcentral/fileexchange/22689),
> after hacking around with it a little bit.

I'm glad you were able to solve your problem. I think I wasn't clear in my response. Just to clarify, the solution to my problem was to install

Developer Tools> Windows Development Tools

in addition to Developer Tools>Compilers and Developer Tools>Headers.

Before I installed that I did not have an mt.exe anywhere on my machine.

Regards

Subject: R2009b Visual Studio 2008 / Win7 x64

From: Kevin Kyyro

Date: 9 Jun, 2010 18:26:22

Message: 18 of 25

"Iulian " <iulian.nita@upb.ro> wrote in message <hth3d9$ak7$1@fred.mathworks.com>...
> "Christopher " <christopher.mayhew@gmail.com> wrote in message <hrs299$8n5$1@fred.mathworks.com>...
> > "David Izhaky" <david@opt-imaging.com> wrote in message <he3og0$8au$1@fred.mathworks.com>...
> > > I installed Visual Studio 2008 Express in my Win7 x64 and cannot get the compiler to compile a mex file. I tried all suggestions here and other places, and still it does not work. I also installed the trial version of Visual Studio 2008.
> > >
> > > This is the error I am getting after configuring mex:
> > >
> > > Error: Could not find the 64-bit compiler. This may indicate that the
> > > "X64 Compilers and Tools" or the Microsoft Windows Software
> > > Development Kit (SDK) is not installed. To build 64-bit MEX-files
> > > Microsoft Visual C++ 2008 requires that these two packages are
> > > installed properly.
> > >
> > > and this is the error I am getting when execute mex yprime.c
> > >
> > > Error: Could not find the compiler "cl" on the DOS path.
> > > Use mex -setup to configure your environment properly.
> > >
> > >
> > > C:\PROGRA~1\MATLAB\R2009B\BIN\MEX.PL: Error: Unable to locate compiler.
> > >
> > > ??? Error using ==> mex at 221
> > > Unable to complete successfully.
> >
> > Sorry for the quick double-post on this subject, but I found something interesting.
> >
> > Previously, I had installed MS Visual Studio 2008 first, then the SDK, as described here:
> > http://www.mathworks.com/support/solutions/en/data/1-6IJJ3L/index.html?solution=1-6IJJ3L
> >
> > However, MATLAB was still unable to find the x64 compiler.
> >
> > Then, today, I reinstalled MS VS, or rather, I ran the setup again and "repaired" the installation. To my surprise, it appeared that more x64 options were being installed than before. Perhaps this installation recognized the MS SDK installation and decided to install more x64 stuff on its own. Also to my surprise, MATLAB afterwards found the x64 compiler. Does the SDK (only Developer Tools > Visual C++ Compilers) need to be installed *before* Visual Studio?
> >
> > At any rate, at least the Simulink Accelerator appears to be working now. Unfortunately, I'm having trouble using Embedded MATLAB blocks in Simulink and I cannot run mex on the example in the solution page above. When I run the following code:
> >
> > copyfile(fullfile(matlabroot,'extern','examples','mex','yprime.c'))
> > mex -v yprime.c
> > yprime(1,1:4)
> >
> > I get at the output:
> >
> > 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_LY~1\templib.x" /MAP:"yprime.mexw64.map"
> > LINKDEBUGFLAGS = /DEBUG /PDB:"yprime.mexw64.pdb"
> > LINKFLAGSPOST =
> > Name directive = /out:"yprime.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_LY~1\yprime.obj -IC:\PROGRA~1\MATLAB\R2009B\extern\include -IC:\PROGRA~1\MATLAB\R2009B\simulink\include /O2 /Oy- /DNDEBUG -DMX_COMPAT_32 yprime.c
> >
> > yprime.c
> > yprime.c(85) : warning C4267: '=' : conversion from 'size_t' to 'mwSize', possible loss of data
> > yprime.c(86) : warning C4267: '=' : conversion from 'size_t' to 'mwSize', possible loss of data
> > Contents of C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_LY~1\mex_tmp.rsp:
> > C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_LY~1\yprime.obj
> >
> >
> > --> link /out:"yprime.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_LY~1\templib.x" /MAP:"yprime.mexw64.map" @C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_LY~1\MEX_TMP.RSP
> >
> > Creating library C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_LY~1\templib.x and object C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_LY~1\templib.exp
> >
> > --> del "C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_LY~1\templib.x" "C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_LY~1\templib.exp"
> >
> >
> > --> mt -outputresource:"yprime.mexw64;2" -manifest "yprime.mexw64.manifest"
> >
> > 'mt' is not recognized as an internal or external command,
> > operable program or batch file.
> >
> > --> del "yprime.mexw64.manifest"
> >
> >
> > --> del "yprime.mexw64.map"
> >
> > ??? Invalid MEX-file 'C:\cygwin\home\Chris\research\rotations\so3\simulation\yprime.mexw64': The specified module could not be found.
> >
> >
> > Unfortunately, a search on this error yielded only the following page:
> > http://www.mathworks.com/matlabcentral/newsreader/view_thread/166600
> >
> > I will see if I can get MATLAB to find 'mt' as well.
>
> Hello,
>
> I had the same problem. It seems that "Microsoft Windows SDK for Windows 7 and .NET Framework 4" released in May 2010 have a bug : the mexopts.bat file is not correctly generated . I uninstall this version and install "Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 Service Pack 1" from that link http://www.microsoft.com/downloads/details.aspx?FamilyID=c17ba869-9671-4330-a63e-1fd44e0e2505&displaylang=en . If it still doesn't work, I can send you my mexopts.bat file. I tested on two different PC ( Windows 7 64 bit) and works very good.
> Please let me know if this solves your problem.
>
> Best regards,
> Iulian

Hey, I tried pretty much every solution on this page, and I'm not having any luck. I'm using windows 7 x64 and matlab r2009b. So, could you send me your mexopts.bat file?
My email should be available on my profile. Thank you so much!

Subject: R2009b Visual Studio 2008 / Win7 x64

From: Chien-Chun Yang

Date: 8 Nov, 2010 18:38:04

Message: 19 of 25

"David Izhaky" <david@opt-imaging.com> wrote in message <he3og0$8au$1@fred.mathworks.com>...
> I installed Visual Studio 2008 Express in my Win7 x64 and cannot get the compiler to compile a mex file. I tried all suggestions here and other places, and still it does not work. I also installed the trial version of Visual Studio 2008.
>
> This is the error I am getting after configuring mex:
>
> Error: Could not find the 64-bit compiler. This may indicate that the
> "X64 Compilers and Tools" or the Microsoft Windows Software
> Development Kit (SDK) is not installed. To build 64-bit MEX-files
> Microsoft Visual C++ 2008 requires that these two packages are
> installed properly.
>
> and this is the error I am getting when execute mex yprime.c
>
> Error: Could not find the compiler "cl" on the DOS path.
> Use mex -setup to configure your environment properly.
>
>
> C:\PROGRA~1\MATLAB\R2009B\BIN\MEX.PL: Error: Unable to locate compiler.
>
> ??? Error using ==> mex at 221
> Unable to complete successfully.

Subject: R2009b Visual Studio 2008 / Win7 x64

From: Chien-Chun Yang

Date: 8 Nov, 2010 18:43:04

Message: 20 of 25

Hello David and other users,
   I am having exactly the same problem you giuys have with the 2009b(x64) Matlab compiler problem with the downloades Microsoft C++ 2010 express and SDK 7.1. My problems has not been solved. I cannot select the compiler from the matlab and don't know how to find the exact that matlab is looking for. May you guys have any solution already? Would you please help me?
   I am also getting the exact error message like this:

   Error: Could not find the compiler "cl" on the DOS path.
          Use mex -setup to configure your environment properly.
  
  
   C:\PROGRA~1\MATLAB\R2009B\BIN\MEX.PL: Error: Unable to locate compiler.
  
 ??? Error using ==> mex at 221
Unable to complete successfully.

Any suggestion!?
Thanks so mcuh.


"David Izhaky" <david@opt-imaging.com> wrote in message <he3og0$8au$1@fred.mathworks.com>...
> I installed Visual Studio 2008 Express in my Win7 x64 and cannot get the compiler to compile a mex file. I tried all suggestions here and other places, and still it does not work. I also installed the trial version of Visual Studio 2008.
>
> This is the error I am getting after configuring mex:
>
> Error: Could not find the 64-bit compiler. This may indicate that the
> "X64 Compilers and Tools" or the Microsoft Windows Software
> Development Kit (SDK) is not installed. To build 64-bit MEX-files
> Microsoft Visual C++ 2008 requires that these two packages are
> installed properly.
>
> and this is the error I am getting when execute mex yprime.c
>
> Error: Could not find the compiler "cl" on the DOS path.
> Use mex -setup to configure your environment properly.
>
>
> C:\PROGRA~1\MATLAB\R2009B\BIN\MEX.PL: Error: Unable to locate compiler.
>
> ??? Error using ==> mex at 221
> Unable to complete successfully.

Subject: R2009b Visual Studio 2008 / Win7 x64

From: Jason Wilkes

Date: 3 Dec, 2010 22:54:04

Message: 21 of 25

 If it still doesn't work, I can send you my mexopts.bat file. I tested on two different PC ( Windows 7 64 bit) and works very good.

Could you send me your mexopts file and a quick readme on where to place it please. My Email is avail on my profile.

Jason

Subject: R2009b Visual Studio 2008 / Win7 x64

From: Sunitha George

Date: 20 Sep, 2011 21:56:29

Message: 22 of 25

"Iulian" wrote in message <hth3d9$ak7$1@fred.mathworks.com>...
> "Christopher " <christopher.mayhew@gmail.com> wrote in message <hrs299$8n5$1@fred.mathworks.com>...
> > "David Izhaky" <david@opt-imaging.com> wrote in message <he3og0$8au$1@fred.mathworks.com>...
> > > I installed Visual Studio 2008 Express in my Win7 x64 and cannot get the compiler to compile a mex file. I tried all suggestions here and other places, and still it does not work. I also installed the trial version of Visual Studio 2008.
> > >
> > > This is the error I am getting after configuring mex:
> > >
> > > Error: Could not find the 64-bit compiler. This may indicate that the
> > > "X64 Compilers and Tools" or the Microsoft Windows Software
> > > Development Kit (SDK) is not installed. To build 64-bit MEX-files
> > > Microsoft Visual C++ 2008 requires that these two packages are
> > > installed properly.
> > >
> > > and this is the error I am getting when execute mex yprime.c
> > >
> > > Error: Could not find the compiler "cl" on the DOS path.
> > > Use mex -setup to configure your environment properly.
> > >
> > >
> > > C:\PROGRA~1\MATLAB\R2009B\BIN\MEX.PL: Error: Unable to locate compiler.
> > >
> > > ??? Error using ==> mex at 221
> > > Unable to complete successfully.
> >
> > Sorry for the quick double-post on this subject, but I found something interesting.
> >
> > Previously, I had installed MS Visual Studio 2008 first, then the SDK, as described here:
> > http://www.mathworks.com/support/solutions/en/data/1-6IJJ3L/index.html?solution=1-6IJJ3L
> >
> > However, MATLAB was still unable to find the x64 compiler.
> >
> > Then, today, I reinstalled MS VS, or rather, I ran the setup again and "repaired" the installation. To my surprise, it appeared that more x64 options were being installed than before. Perhaps this installation recognized the MS SDK installation and decided to install more x64 stuff on its own. Also to my surprise, MATLAB afterwards found the x64 compiler. Does the SDK (only Developer Tools > Visual C++ Compilers) need to be installed *before* Visual Studio?
> >
> > At any rate, at least the Simulink Accelerator appears to be working now. Unfortunately, I'm having trouble using Embedded MATLAB blocks in Simulink and I cannot run mex on the example in the solution page above. When I run the following code:
> >
> > copyfile(fullfile(matlabroot,'extern','examples','mex','yprime.c'))
> > mex -v yprime.c
> > yprime(1,1:4)
> >
> > I get at the output:
> >
> > 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_LY~1\templib.x" /MAP:"yprime.mexw64.map"
> > LINKDEBUGFLAGS = /DEBUG /PDB:"yprime.mexw64.pdb"
> > LINKFLAGSPOST =
> > Name directive = /out:"yprime.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_LY~1\yprime.obj -IC:\PROGRA~1\MATLAB\R2009B\extern\include -IC:\PROGRA~1\MATLAB\R2009B\simulink\include /O2 /Oy- /DNDEBUG -DMX_COMPAT_32 yprime.c
> >
> > yprime.c
> > yprime.c(85) : warning C4267: '=' : conversion from 'size_t' to 'mwSize', possible loss of data
> > yprime.c(86) : warning C4267: '=' : conversion from 'size_t' to 'mwSize', possible loss of data
> > Contents of C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_LY~1\mex_tmp.rsp:
> > C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_LY~1\yprime.obj
> >
> >
> > --> link /out:"yprime.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_LY~1\templib.x" /MAP:"yprime.mexw64.map" @C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_LY~1\MEX_TMP.RSP
> >
> > Creating library C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_LY~1\templib.x and object C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_LY~1\templib.exp
> >
> > --> del "C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_LY~1\templib.x" "C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_LY~1\templib.exp"
> >
> >
> > --> mt -outputresource:"yprime.mexw64;2" -manifest "yprime.mexw64.manifest"
> >
> > 'mt' is not recognized as an internal or external command,
> > operable program or batch file.
> >
> > --> del "yprime.mexw64.manifest"
> >
> >
> > --> del "yprime.mexw64.map"
> >
> > ??? Invalid MEX-file 'C:\cygwin\home\Chris\research\rotations\so3\simulation\yprime.mexw64': The specified module could not be found.
> >
> >
> > Unfortunately, a search on this error yielded only the following page:
> > http://www.mathworks.com/matlabcentral/newsreader/view_thread/166600
> >
> > I will see if I can get MATLAB to find 'mt' as well.
>
> Hello,
>
> I had the same problem. It seems that "Microsoft Windows SDK for Windows 7 and .NET Framework 4" released in May 2010 have a bug : the mexopts.bat file is not correctly generated . I uninstall this version and install "Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 Service Pack 1" from that link http://www.microsoft.com/downloads/details.aspx?FamilyID=c17ba869-9671-4330-a63e-1fd44e0e2505&displaylang=en . If it still doesn't work, I can send you my mexopts.bat file. I tested on two different PC ( Windows 7 64 bit) and works very good.
> Please let me know if this solves your problem.
>
> Best regards,
> Iulian

Hi Iulian,
I also have the similar problem and tried everything described in this post. Could you send me your mexopts.bat file. That's the only other option left for me to try as of now. My email id is sageorge@usc.edu

Thanks in advance
Sunitha

Subject: R2009b Visual Studio 2008 / Win7 x64

From: Kaibo

Date: 30 Oct, 2011 17:59:10

Message: 23 of 25

"Iulian" wrote in message <hth3d9$ak7$1@fred.mathworks.com>...
> "Christopher " <christopher.mayhew@gmail.com> wrote in message <hrs299$8n5$1@fred.mathworks.com>...
> > "David Izhaky" <david@opt-imaging.com> wrote in message <he3og0$8au$1@fred.mathworks.com>...
> > > I installed Visual Studio 2008 Express in my Win7 x64 and cannot get the compiler to compile a mex file. I tried all suggestions here and other places, and still it does not work. I also installed the trial version of Visual Studio 2008.
> > >
> > > This is the error I am getting after configuring mex:
> > >
> > > Error: Could not find the 64-bit compiler. This may indicate that the
> > > "X64 Compilers and Tools" or the Microsoft Windows Software
> > > Development Kit (SDK) is not installed. To build 64-bit MEX-files
> > > Microsoft Visual C++ 2008 requires that these two packages are
> > > installed properly.
> > >
> > > and this is the error I am getting when execute mex yprime.c
> > >
> > > Error: Could not find the compiler "cl" on the DOS path.
> > > Use mex -setup to configure your environment properly.
> > >
> > >
> > > C:\PROGRA~1\MATLAB\R2009B\BIN\MEX.PL: Error: Unable to locate compiler.
> > >
> > > ??? Error using ==> mex at 221
> > > Unable to complete successfully.
> >
> > Sorry for the quick double-post on this subject, but I found something interesting.
> >
> > Previously, I had installed MS Visual Studio 2008 first, then the SDK, as described here:
> > http://www.mathworks.com/support/solutions/en/data/1-6IJJ3L/index.html?solution=1-6IJJ3L
> >
> > However, MATLAB was still unable to find the x64 compiler.
> >
> > Then, today, I reinstalled MS VS, or rather, I ran the setup again and "repaired" the installation. To my surprise, it appeared that more x64 options were being installed than before. Perhaps this installation recognized the MS SDK installation and decided to install more x64 stuff on its own. Also to my surprise, MATLAB afterwards found the x64 compiler. Does the SDK (only Developer Tools > Visual C++ Compilers) need to be installed *before* Visual Studio?
> >
> > At any rate, at least the Simulink Accelerator appears to be working now. Unfortunately, I'm having trouble using Embedded MATLAB blocks in Simulink and I cannot run mex on the example in the solution page above. When I run the following code:
> >
> > copyfile(fullfile(matlabroot,'extern','examples','mex','yprime.c'))
> > mex -v yprime.c
> > yprime(1,1:4)
> >
> > I get at the output:
> >
> > 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_LY~1\templib.x" /MAP:"yprime.mexw64.map"
> > LINKDEBUGFLAGS = /DEBUG /PDB:"yprime.mexw64.pdb"
> > LINKFLAGSPOST =
> > Name directive = /out:"yprime.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_LY~1\yprime.obj -IC:\PROGRA~1\MATLAB\R2009B\extern\include -IC:\PROGRA~1\MATLAB\R2009B\simulink\include /O2 /Oy- /DNDEBUG -DMX_COMPAT_32 yprime.c
> >
> > yprime.c
> > yprime.c(85) : warning C4267: '=' : conversion from 'size_t' to 'mwSize', possible loss of data
> > yprime.c(86) : warning C4267: '=' : conversion from 'size_t' to 'mwSize', possible loss of data
> > Contents of C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_LY~1\mex_tmp.rsp:
> > C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_LY~1\yprime.obj
> >
> >
> > --> link /out:"yprime.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_LY~1\templib.x" /MAP:"yprime.mexw64.map" @C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_LY~1\MEX_TMP.RSP
> >
> > Creating library C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_LY~1\templib.x and object C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_LY~1\templib.exp
> >
> > --> del "C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_LY~1\templib.x" "C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_LY~1\templib.exp"
> >
> >
> > --> mt -outputresource:"yprime.mexw64;2" -manifest "yprime.mexw64.manifest"
> >
> > 'mt' is not recognized as an internal or external command,
> > operable program or batch file.
> >
> > --> del "yprime.mexw64.manifest"
> >
> >
> > --> del "yprime.mexw64.map"
> >
> > ??? Invalid MEX-file 'C:\cygwin\home\Chris\research\rotations\so3\simulation\yprime.mexw64': The specified module could not be found.
> >
> >
> > Unfortunately, a search on this error yielded only the following page:
> > http://www.mathworks.com/matlabcentral/newsreader/view_thread/166600
> >
> > I will see if I can get MATLAB to find 'mt' as well.
>
> Hello,
>
> I had the same problem. It seems that "Microsoft Windows SDK for Windows 7 and .NET Framework 4" released in May 2010 have a bug : the mexopts.bat file is not correctly generated . I uninstall this version and install "Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 Service Pack 1" from that link http://www.microsoft.com/downloads/details.aspx?FamilyID=c17ba869-9671-4330-a63e-1fd44e0e2505&displaylang=en . If it still doesn't work, I can send you my mexopts.bat file. I tested on two different PC ( Windows 7 64 bit) and works very good.
> Please let me know if this solves your problem.
>
> Best regards,
> Iulian

Hi Iulian,
I also have the similar problem and tried everything. Could you please send me your mexopts.bat file.
Thanks in advance for your great help!
Best Regards,
Kaibo

Subject: R2009b Visual Studio 2008 / Win7 x64

From: Kaibo

Date: 30 Oct, 2011 18:01:11

Message: 24 of 25

"Iulian" wrote in message <hth3d9$ak7$1@fred.mathworks.com>...
> "Christopher " <christopher.mayhew@gmail.com> wrote in message <hrs299$8n5$1@fred.mathworks.com>...
> > "David Izhaky" <david@opt-imaging.com> wrote in message <he3og0$8au$1@fred.mathworks.com>...
> > > I installed Visual Studio 2008 Express in my Win7 x64 and cannot get the compiler to compile a mex file. I tried all suggestions here and other places, and still it does not work. I also installed the trial version of Visual Studio 2008.
> > >
> > > This is the error I am getting after configuring mex:
> > >
> > > Error: Could not find the 64-bit compiler. This may indicate that the
> > > "X64 Compilers and Tools" or the Microsoft Windows Software
> > > Development Kit (SDK) is not installed. To build 64-bit MEX-files
> > > Microsoft Visual C++ 2008 requires that these two packages are
> > > installed properly.
> > >
> > > and this is the error I am getting when execute mex yprime.c
> > >
> > > Error: Could not find the compiler "cl" on the DOS path.
> > > Use mex -setup to configure your environment properly.
> > >
> > >
> > > C:\PROGRA~1\MATLAB\R2009B\BIN\MEX.PL: Error: Unable to locate compiler.
> > >
> > > ??? Error using ==> mex at 221
> > > Unable to complete successfully.
> >
> > Sorry for the quick double-post on this subject, but I found something interesting.
> >
> > Previously, I had installed MS Visual Studio 2008 first, then the SDK, as described here:
> > http://www.mathworks.com/support/solutions/en/data/1-6IJJ3L/index.html?solution=1-6IJJ3L
> >
> > However, MATLAB was still unable to find the x64 compiler.
> >
> > Then, today, I reinstalled MS VS, or rather, I ran the setup again and "repaired" the installation. To my surprise, it appeared that more x64 options were being installed than before. Perhaps this installation recognized the MS SDK installation and decided to install more x64 stuff on its own. Also to my surprise, MATLAB afterwards found the x64 compiler. Does the SDK (only Developer Tools > Visual C++ Compilers) need to be installed *before* Visual Studio?
> >
> > At any rate, at least the Simulink Accelerator appears to be working now. Unfortunately, I'm having trouble using Embedded MATLAB blocks in Simulink and I cannot run mex on the example in the solution page above. When I run the following code:
> >
> > copyfile(fullfile(matlabroot,'extern','examples','mex','yprime.c'))
> > mex -v yprime.c
> > yprime(1,1:4)
> >
> > I get at the output:
> >
> > 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_LY~1\templib.x" /MAP:"yprime.mexw64.map"
> > LINKDEBUGFLAGS = /DEBUG /PDB:"yprime.mexw64.pdb"
> > LINKFLAGSPOST =
> > Name directive = /out:"yprime.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_LY~1\yprime.obj -IC:\PROGRA~1\MATLAB\R2009B\extern\include -IC:\PROGRA~1\MATLAB\R2009B\simulink\include /O2 /Oy- /DNDEBUG -DMX_COMPAT_32 yprime.c
> >
> > yprime.c
> > yprime.c(85) : warning C4267: '=' : conversion from 'size_t' to 'mwSize', possible loss of data
> > yprime.c(86) : warning C4267: '=' : conversion from 'size_t' to 'mwSize', possible loss of data
> > Contents of C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_LY~1\mex_tmp.rsp:
> > C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_LY~1\yprime.obj
> >
> >
> > --> link /out:"yprime.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_LY~1\templib.x" /MAP:"yprime.mexw64.map" @C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_LY~1\MEX_TMP.RSP
> >
> > Creating library C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_LY~1\templib.x and object C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_LY~1\templib.exp
> >
> > --> del "C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_LY~1\templib.x" "C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_LY~1\templib.exp"
> >
> >
> > --> mt -outputresource:"yprime.mexw64;2" -manifest "yprime.mexw64.manifest"
> >
> > 'mt' is not recognized as an internal or external command,
> > operable program or batch file.
> >
> > --> del "yprime.mexw64.manifest"
> >
> >
> > --> del "yprime.mexw64.map"
> >
> > ??? Invalid MEX-file 'C:\cygwin\home\Chris\research\rotations\so3\simulation\yprime.mexw64': The specified module could not be found.
> >
> >
> > Unfortunately, a search on this error yielded only the following page:
> > http://www.mathworks.com/matlabcentral/newsreader/view_thread/166600
> >
> > I will see if I can get MATLAB to find 'mt' as well.
>
> Hello,
>
> I had the same problem. It seems that "Microsoft Windows SDK for Windows 7 and .NET Framework 4" released in May 2010 have a bug : the mexopts.bat file is not correctly generated . I uninstall this version and install "Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 Service Pack 1" from that link http://www.microsoft.com/downloads/details.aspx?FamilyID=c17ba869-9671-4330-a63e-1fd44e0e2505&displaylang=en . If it still doesn't work, I can send you my mexopts.bat file. I tested on two different PC ( Windows 7 64 bit) and works very good.
> Please let me know if this solves your problem.
>
> Best regards,
> Iulian

Hi Iulian,
I also have the similar problem. Could you please send me your mexopts.bat file. My email is jacoblkb@gmail.com

Thanks in advance for your help!
Best,
Kaibo

Subject: R2009b Visual Studio 2008 / Win7 x64

From: behdad sh

Date: 6 Jan, 2012 12:45:10

Message: 25 of 25

"Kaibo " <jacoblkb@gmail.com> wrote in message <j8k3d7$hat$1@newscl01ah.mathworks.com>...
> "Iulian" wrote in message <hth3d9$ak7$1@fred.mathworks.com>...
> > "Christopher " <christopher.mayhew@gmail.com> wrote in message <hrs299$8n5$1@fred.mathworks.com>...
> > > "David Izhaky" <david@opt-imaging.com> wrote in message <he3og0$8au$1@fred.mathworks.com>...
> > > > I installed Visual Studio 2008 Express in my Win7 x64 and cannot get the compiler to compile a mex file. I tried all suggestions here and other places, and still it does not work. I also installed the trial version of Visual Studio 2008.
> > > >
> > > > This is the error I am getting after configuring mex:
> > > >
> > > > Error: Could not find the 64-bit compiler. This may indicate that the
> > > > "X64 Compilers and Tools" or the Microsoft Windows Software
> > > > Development Kit (SDK) is not installed. To build 64-bit MEX-files
> > > > Microsoft Visual C++ 2008 requires that these two packages are
> > > > installed properly.
> > > >
> > > > and this is the error I am getting when execute mex yprime.c
> > > >
> > > > Error: Could not find the compiler "cl" on the DOS path.
> > > > Use mex -setup to configure your environment properly.
> > > >
> > > >
> > > > C:\PROGRA~1\MATLAB\R2009B\BIN\MEX.PL: Error: Unable to locate compiler.
> > > >
> > > > ??? Error using ==> mex at 221
> > > > Unable to complete successfully.
> > >
> > > Sorry for the quick double-post on this subject, but I found something interesting.
> > >
> > > Previously, I had installed MS Visual Studio 2008 first, then the SDK, as described here:
> > > http://www.mathworks.com/support/solutions/en/data/1-6IJJ3L/index.html?solution=1-6IJJ3L
> > >
> > > However, MATLAB was still unable to find the x64 compiler.
> > >
> > > Then, today, I reinstalled MS VS, or rather, I ran the setup again and "repaired" the installation. To my surprise, it appeared that more x64 options were being installed than before. Perhaps this installation recognized the MS SDK installation and decided to install more x64 stuff on its own. Also to my surprise, MATLAB afterwards found the x64 compiler. Does the SDK (only Developer Tools > Visual C++ Compilers) need to be installed *before* Visual Studio?
> > >
> > > At any rate, at least the Simulink Accelerator appears to be working now. Unfortunately, I'm having trouble using Embedded MATLAB blocks in Simulink and I cannot run mex on the example in the solution page above. When I run the following code:
> > >
> > > copyfile(fullfile(matlabroot,'extern','examples','mex','yprime.c'))
> > > mex -v yprime.c
> > > yprime(1,1:4)
> > >
> > > I get at the output:
> > >
> > > 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_LY~1\templib.x" /MAP:"yprime.mexw64.map"
> > > LINKDEBUGFLAGS = /DEBUG /PDB:"yprime.mexw64.pdb"
> > > LINKFLAGSPOST =
> > > Name directive = /out:"yprime.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_LY~1\yprime.obj -IC:\PROGRA~1\MATLAB\R2009B\extern\include -IC:\PROGRA~1\MATLAB\R2009B\simulink\include /O2 /Oy- /DNDEBUG -DMX_COMPAT_32 yprime.c
> > >
> > > yprime.c
> > > yprime.c(85) : warning C4267: '=' : conversion from 'size_t' to 'mwSize', possible loss of data
> > > yprime.c(86) : warning C4267: '=' : conversion from 'size_t' to 'mwSize', possible loss of data
> > > Contents of C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_LY~1\mex_tmp.rsp:
> > > C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_LY~1\yprime.obj
> > >
> > >
> > > --> link /out:"yprime.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_LY~1\templib.x" /MAP:"yprime.mexw64.map" @C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_LY~1\MEX_TMP.RSP
> > >
> > > Creating library C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_LY~1\templib.x and object C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_LY~1\templib.exp
> > >
> > > --> del "C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_LY~1\templib.x" "C:\USERS\CHRIS\APPDATA\LOCAL\TEMP\MEX_LY~1\templib.exp"
> > >
> > >
> > > --> mt -outputresource:"yprime.mexw64;2" -manifest "yprime.mexw64.manifest"
> > >
> > > 'mt' is not recognized as an internal or external command,
> > > operable program or batch file.
> > >
> > > --> del "yprime.mexw64.manifest"
> > >
> > >
> > > --> del "yprime.mexw64.map"
> > >
> > > ??? Invalid MEX-file 'C:\cygwin\home\Chris\research\rotations\so3\simulation\yprime.mexw64': The specified module could not be found.
> > >
> > >
> > > Unfortunately, a search on this error yielded only the following page:
> > > http://www.mathworks.com/matlabcentral/newsreader/view_thread/166600
> > >
> > > I will see if I can get MATLAB to find 'mt' as well.
> >
> > Hello,
> >
> > I had the same problem. It seems that "Microsoft Windows SDK for Windows 7 and .NET Framework 4" released in May 2010 have a bug : the mexopts.bat file is not correctly generated . I uninstall this version and install "Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 Service Pack 1" from that link http://www.microsoft.com/downloads/details.aspx?FamilyID=c17ba869-9671-4330-a63e-1fd44e0e2505&displaylang=en . If it still doesn't work, I can send you my mexopts.bat file. I tested on two different PC ( Windows 7 64 bit) and works very good.
> > Please let me know if this solves your problem.
> >
> > Best regards,
> > Iulian
>
> Hi Iulian,
> I also have the similar problem. Could you please send me your mexopts.bat file. My email is jacoblkb@gmail.com
>
> Thanks in advance for your help!
> Best,
> Kaibo

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us