MATLAB: Do I receive an error when I use the LOADLIBRARY command in MATLAB 7.10 (R2010a)

2008loadlibraryMATLABmsvcpreprocessorx64

I am using 64-bit MATLAB on 64-bit Windows. I have installed Visual Studio 2008 as well. However when I try to load a library with the LOADLIBRARY command this way:
addpath([matlabroot '\extern\examples\shrlib'])
loadlibrary shrlibsample shrlibsample.h
I get the error:
??? Error using ==> loadlibrary at 368
Failed to preprocess the input file.
Output from preprocessor is:'cl' is not recognized as an internal or external command,
operable program or batch file.
I would like to know why I get this error even though I have the supported MSVC 2008 professional edition installed on my machine.

Best Answer

This error message means that the x64 Compilers and Tools was not installed during the MSVC installation.
The default installation of Visual Studio 2008 is only capable of building 32-bit binaries, and will not work with MATLAB. In order to build 64-bit binaries, the "x64 Compilers and Tools" and Microsoft Windows Software Development Kit (SDK) must both be installed. The x64 Compilers and Tools are not installed by default.
Related Question