필터 지우기
필터 지우기

“Unable to locate compiler” mex error when using Visual C++ 2010 Express SP1 on 64-bit Windows

조회 수: 6 (최근 30일)
I had a working combination of Visual C++ 2010 Express and Microsoft Windows SDK 7.1. After installing Service Pack 1 for Visual Studio, I now get the following MEX error:
Error: Could not find the compiler "cl" on the DOS path.
Use mex -setup to configure your environment properly.
C:\Program Files\MATLAB\R2010B\BIN\MEX.PL: Error: Unable to locate compiler.
How can I get back to a working configuration?

채택된 답변

Ken Atwell
Ken Atwell 2011년 4월 14일
This problem impacts MATLAB users with the following combination of software on 64-bit Windows (win64):
  • Visual C++ 2010 Express
  • Microsoft Windows SDK 7.1
  • Visual Studio 2010 SP1
There is a bug in the installer for Visual Studio 2010 SP1. The installer will delete the 64-bit compiler previously installed by the SDK, or prevent the compiler from being later installed by the SDK.
This will prevent MEX and other products and features dependent on a compiler from functioning. "mex –setup" will continue to locate the Visual C++ compiler, but a "mex" call will later fail with a message like the following:
Error: Could not find the compiler "cl" on the DOS path.
Use mex -setup to configure your environment properly.
C:\Program Files\MATLAB\R2010B\BIN\MEX.PL: Error: Unable to locate compiler.
Microsoft has issued an update to address this issue. It is available for download at:
After downloading and installing the update, MEX and other capabilities should work as anticipated.
  댓글 수: 5
Mark Mikofski
Mark Mikofski 2012년 8월 30일
  1. Yes, MSVC100 is still compatible with MATLAB 2011a/b x86 (for x64 you must have Windows SDK 7.1). See Supported and Compatible Compilers – Release 2011a.
  2. Did you try clearing the "C++ compilers" check-box during install of Windows SDK 7.1? Then install the update.
From KB2519277:
If you try to install Windows SDK v7.1 after you upgrade to Visual Studio 2010 SP1, the Visual C++ compiler features might be blocked during the setup process. To resolve this issue, run the Windows SDK 7.1 Setup again, clear the Visual C++ Compilers check box, and then complete the setup. After Windows SDK v7.1 is installed, install the update that is described in the "Update information" section.
Jan
Jan 2012년 8월 30일
편집: Jan 2012년 8월 30일
@Mark: Does this "yes" concern my question? I asked for MSVC 2010 Express SP1, but the list of compatible compilers for R2011a/b mentions MSVC 2010 Express & Professional without service pack only. Even the technical support of TMW could not clear this question yet.
The thread is one year old. My problems are solved already.

댓글을 달려면 로그인하십시오.

추가 답변 (2개)

Bjoern
Bjoern 2012년 3월 19일
Worked for me! Thx Ken

K1
K1 2013년 4월 30일
Perfect! one way or another I hadn't found this answer... thank you!

카테고리

Help CenterFile Exchange에서 C Shared Library Integration에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by