Mingw not working for C++ compilation

조회 수: 7 (최근 30일)
Darshna
Darshna 2025년 5월 15일
댓글: Hitesh 2025년 6월 2일
Hi,
I have installed mingw from add-ons in MATLAB2022b,
when i run command: mex -setup C --> MATLAB detects mingw
but when i run command: mex -setup C++ --> MATLAB is unable to locate it.
version : MinGW-W64-builds-4.3.0

답변 (1개)

Hitesh
Hitesh 2025년 5월 16일
편집: Hitesh 2025년 5월 16일
Hi Darshna,
Since you already appeared to have an existing installation of the MinGW Support Package, it is much easier if you just edit the system environment variable MW_MINGW64_LOC in the Windows settings (with the help of an admin) to have this value:
C:\Program Files\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev2\mingw64
(which is where the MinGW compiler shipped with the support package resides).
Then, restart MATLAB.
For more information regarding this issue, kindly refer to the following MATLAB Answer:
  댓글 수: 4
Darshna
Darshna 2025년 5월 16일
Hi Hitesh,
Thanks for responding.
I am able to run mingwdir = getenv ('MW_MINGW64_LOC')
So I have followed below sequence: first I uninstalled mingw and run
  1. mex -setup
  2. getenv ('MW_MINGW64_LOC')
  3. rehash toolboxcache
Then i installed mingw from add-ons and again run commands:
  1. mex -setup
  2. getenv ('MW_MINGW64_LOC')
  3. rehash toolboxcache
  4. mex --setup C++
MATLAB could't find compiler for cpp.
Is there any possibility of the rights because I opened MATLAB with different user id?
Hitesh
Hitesh 2025년 6월 2일
Hi Darshna,
I think this might be best handled with MathWorks tech support. Could you submit a technical support request?

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

Community Treasure Hunt

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

Start Hunting!

Translated by