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]

 채택된 답변

Friedrich
Friedrich 2013년 10월 17일

20 개 추천

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.

댓글 수: 15

iup geii amiens
iup geii amiens 2014년 8월 13일
Thanks man!!!Very Good Job!!!
gail
gail 2014년 12월 29일
thank you!!!!!!
Jin Hwa Kim
Jin Hwa Kim 2015년 11월 10일
cooooool!
Gauraang  Khurana
Gauraang Khurana 2016년 1월 1일
I dont have that file. Have checked properly. Please help.
VIJENDRA
VIJENDRA 2016년 1월 11일
you are awesome...!!
ANIMA V A
ANIMA V A 2016년 1월 12일
i don't have that file,how can i fix it
Walter Roberson
Walter Roberson 2016년 1월 12일
Above, between Friedrich's Answer and the start of the Comments there is "ammintrin.m". That is a link. You can use your browser to save the content of the link to a file.
Vishnu Teja Vithala
Vishnu Teja Vithala 2016년 8월 3일
If I try to copy paste the file into the folder it doesn't let you do that in Windows 7..The whole directory crashes.
Walter Roberson
Walter Roberson 2016년 8월 3일
Could you explain more what it means for a directory to crash?
Grey Kuling
Grey Kuling 2017년 2월 22일
Thank you so much! This was extremely helpful!
Sivasankar Yarrabothula
Sivasankar Yarrabothula 2017년 3월 21일
Thanks a lot. Its really cool fix
aleksandr klopov
aleksandr klopov 2017년 4월 17일
Thank you!!!
Vasundhara Jain
Vasundhara Jain 2017년 5월 16일
Thank you so much!
Sreeraj a
Sreeraj a 2017년 6월 21일
Thanks !!! That was really Cool
Arunraj anil
Arunraj anil 2018년 5월 21일

Wonderful job man, You save my Day. Sooper Cool.

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

추가 답변 (4개)

James Tursa
James Tursa 2013년 10월 16일

0 개 추천

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.

댓글 수: 1

Jan
Jan 2013년 10월 16일
@James: After formatting the question, it gets clear, that the source file was not listed twice. Formatting is such useful that I cannot understand, why so many newcomers do not use the power or at least ask how to use it. Is it not usual to read a question after one has posted it?

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

izem
izem 2016년 9월 16일

0 개 추천

Thank you It workssssssssssss
Néstor Rodguez
Néstor Rodguez 2016년 12월 6일

0 개 추천

Thank you for all! It's works correctly!
Shubham Pachori
Shubham Pachori 2017년 6월 29일
편집: Walter Roberson 2017년 6월 29일

0 개 추천

Error using mex
gco_matlab.cpp
C:\Users\**\gco-v3.0\matlab\gco_matlab.cpp(8)
: error C2371: 'mwSize' : redefinition; different basic types
c:\program files\matlab\r2016a\extern\include\tmwtypes.h(795) : see
declaration of 'mwSize'
C:\Users\**\gco-v3.0\matlab\gco_matlab.cpp(9)
: 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?

댓글 수: 2

Walter Roberson
Walter Roberson 2017년 6월 29일
Looking at those messages, it appears to me that on line 8 of gco_matlab.cpp that it attempts to define mwSize and on line it attempts to define mwIndex, but that those are already defined by the tmwtypes.h header file. If I am correct, then comment out the typedef at lines 8 and 9 of gco_matlab.cpp
khadija portu
khadija portu 2020년 8월 16일
IT IS NOT CLEAR COULD YOU PROVIDE FOR US MORE INFORMATION

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

카테고리

도움말 센터File Exchange에서 MATLAB Compiler에 대해 자세히 알아보기

제품

질문:

2013년 10월 16일

댓글:

2020년 8월 16일

Community Treasure Hunt

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

Start Hunting!

Translated by