MATLAB: Fix problem when mex .cpp file

MATLABmexmex compiler

Hi all, I have problem when compile mex file.
>> mex GCoptimization.cpp
GCoptimization.cpp
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\intrin.h(26) : fatal error C1083: Cannot open include file: 'ammintrin.h': No such file or directory
C:\PROGRA~1\MATLAB\R2012B\BIN\MEX.PL: Error: Compile of 'GCoptimization.cpp' failed.
Error using mex (line 206) Unable to complete successfully." What is wrong? I have copy all cpp and .h "C:\Users\nambnh\Documents\MATLAB".
[EDITED, code formatted to clarify the line breaks]

Best Answer

Hi,
this is Microsoft Bug see here.
Since I am such a cool guy I attached the header ammintrin.h file which needs to be placed in "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\". Please rename it from ammintrin.m to ammintrin.h because one cannot upload .h files.
I hope that helps.
Related Question