Why does the mex command work for the example, but not for my code?

조회 수: 8 (최근 30일)
Dylan Bronson
Dylan Bronson 2017년 1월 19일
답변: Shrirang Bhadgaonkar 2018년 6월 5일
I am using R2015b. I installed MinGW using the add on explorer and tried out the example shown here: https://www.mathworks.com/help/matlab/ref/mex.html. After running the mex function, I get an output saying:"Building with 'MinGW64 Compiler (C)'. MEX completed successfully"
Then when I go to run my own mex function, I get an error: "Error using mex No supported compiler or SDK was found. You can install the freely available MinGW-w64 C/C++ compiler;"
This does not make sense to me, as I clearly have the MinGW compiler already installed and mex working correctly in other places. Why can't it find the compiler I have installed in this instance but not the other?
  댓글 수: 3
Jan
Jan 2018년 4월 21일
What exactly does this mean: "Then when I go to run my own mex function"?
Shrirang Bhadgaonkar
Shrirang Bhadgaonkar 2018년 6월 5일
I am also facing the same issue. I can see MinGw64 as installed in Add-On Explorer but when I type mex -setup , Matlab does not lists MinGw64 in it. Please help. Thanks in advance.

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

답변 (1개)

Shrirang Bhadgaonkar
Shrirang Bhadgaonkar 2018년 6월 5일
I found the solution to my problem. Check if it is also applicable to you. I found out that after enetering following command "mex -v -setup C", Matlab was skipping MinGW64 installaion because environmental variable"MW_MINGW64_LOC" was not SET. I had reinstalled the MinGw64 but still this vaiable was not on the ENV path. To set this variable in path I used the command and everything went fine. Happy Ending !!! please check the support package installation path. (Note : This is not Good Practice)
setenv('MW_MINGW64_LOC','C:\ProgramData\MATLAB\SupportPackages\R2017b\3P.instrset\mingw_w64.instrset')

카테고리

Help CenterFile Exchange에서 Troubleshooting in MATLAB Compiler SDK에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by