Cannot get compiler to build projects

2 views (last 30 days)
Matt Sall
Matt Sall on 14 Aug 2014
Answered: A Jenkins on 15 Aug 2014
I am having a lot of trouble trying to get my MATLAB to work with a compiler.
I have Windows7 64bit, MATLAB 2007b 64bit, Visual C++ 2005 Express Edition, Microsoft Platform SDK for Windows Server 2003 R2 and Microsoft Windows SDK 6.1. I have not been able to get any of these to compile my code.
Every time I run mbuild -setup or mex -setup (I don't know the difference, so I do both) I go through the whole thing. MATLAB won't automatically locate installed compilers, so I do it myself. I'll pick MS VS C++ 2005 and change the path to C:\Program Files\... instead of C:\Program Files (x86)\... as that's where I've installed that. By the end of attempting to build my project, I get...
Could not find the compiler "cl" on the DOS path.
Use mbuild -setup to configure your environment properly.
C:\PROGRA~1\MATLAB\R2007B\BIN\MEX.PL: Error: Unable to locate compiler.
Error: An error occurred while shelling out to mbuild (error code = 2).
Unable to build executable (specify the -v option for more information).
??? Error using ==> mcc
Error executing mcc, return status = 1.
There were errors during compilation process.
I am running out of ideas and could very much use any amount of help. I've scoured the Internet and can't find any answers. Thank you in advance for any assistance and I'll answer any questions I need to as promptly as possible.

Answers (1)

A Jenkins
A Jenkins on 15 Aug 2014
Did you carefully check the versions you have against the documentation?
For example, the Supported Compilers page says that for MATLAB 2007b 64-bit, you require Microsoft Visual C++ 2005 Professional Edition, not Express. Or you could use Express, and change to MATLAB 2007b 32-bit.


Find more on C Shared Library Integration in Help Center and File Exchange


Community Treasure Hunt

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

Start Hunting!

Translated by