Fix problem when mex .cpp file
108 views (last 30 days)
Nam Bui Nguyen Hoai on 16 Oct 2013
Hi all, I have problem when compile mex file.
>> mex 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]
Friedrich on 17 Oct 2013
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.
More Answers (4)
James Tursa on 16 Oct 2013
Looks like you have spaces in your paths. Rather than passing these arguments to the mex function via the command line "string" approach, try using the function call syntax instead so you can explicitly separate arguments even if they have spaces. And don't put your header .h files in the argument list ... they should already be included in your source code. Also I am not sure why you apparently list the same source file twice.
Shubham Pachori on 29 Jun 2017
Edited: Walter Roberson on 29 Jun 2017
Error using mex
: error C2371: 'mwSize' : redefinition; different basic types
c:\program files\matlab\r2016a\extern\include\tmwtypes.h(795) : see
declaration of 'mwSize'
: error C2371: 'mwIndex' : redefinition; different basic types
c:\program files\matlab\r2016a\extern\include\tmwtypes.h(796) : see
declaration of 'mwIndex'
Error in GCO_BuildLib (line 68)
eval(mexcmd); % compile and link in one step
Error in GCO_UnitTest (line 48)
GCO_BuildLib; disp('BuildLib PASSED');
Hi I am unable to compile gco library in MATLAB2016a in windows. Could someone please help and explain me to get rid of this error?