Does MinGW compiler from Add-Ons on MATLAB cause any problem with MinGW on system?

2 次查看(过去 30 天)
I already have MinGW-w64 on my computer. If I install the MinGW-w64 compiler from Add-Ons on MATLAB, do these two interfer with each other?

回答(1 个)

Rishita
Rishita 2022-7-15
You can test the MinGW® compiler by building the yprime.c example. Copy the source file to a writable folder.
copyfile(fullfile(matlabroot,'extern','examples','mex','yprime.c'),'.','f')
If you only have the MinGW compiler installed on your system, the mex command automatically chooses MinGW. Go to the next step. However, if you have multiple C or C++ compilers, use mex -setup to choose MinGW.
mex -setup
Build the MEX file.
mex yprime.c
MATLAB displays a “Building with” message showing what compiler was used to build the MEX file.
Run the function.
yprime(1,1:4)
  1 个评论
Fujibayashi Mizuki
Fujibayashi Mizuki 2022-7-15
Thank you for your reply.
When I tried
mex -setup
only with MinGW on my computer, I got error saying MATLAB could not find any compiler.(Sorry actual error was japanese.)
There might be some problems with my paths though.
I found answers recomending download of MATLAB function 'configuremingw' but I did not understand where it was attached.
And, just for information, of course MinGW from Add-Ons on MATLAB enabled me building the mex file.
I put the mingw under 'C: without any space but failed. But I might find helpfull hints from the link you mentioned, so I'll check it more carefully.
Thank you!!

请先登录,再进行评论。

Community Treasure Hunt

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

Start Hunting!

Translated by