!which gcc doesn't work

조회 수: 9 (최근 30일)
abi aryan
abi aryan 2019년 7월 8일
댓글: Walter Roberson 2019년 7월 8일
Hey, pretty new to Matlab here. I am trying to get matlab to work with matconvnet so I installed the -mex compiler support for Windows using Add-Ons.
Finally, did -mex setup and this gives
configured to use 'MinGW64 Compiler (C)' for C language compilation.
Warning: The MATLAB C and Fortran API has changed to support MATLAB
variables with more than 2^32-1 elements. You will be required
to update your code to utilize the new API.
You can find more information about this at:
https://www.mathworks.com/help/matlab/matlab_external/upgrading-mex-files-to-use-64-bit-api.html.
To choose a different language, select one from the following:
mex -setup C++
mex -setup FORTRAN
MEX configured to use 'MinGW64 Compiler (C++)' for C++ language compilation.
Warning: The MATLAB C and Fortran API has changed to support MATLAB
variables with more than 2^32-1 elements. You will be required
to update your code to utilize the new API.
Now, I tried to do !which gcc to test which compiler am I using but it was giving an error that said
>> !which gcc
'which' is not recognized as an internal or external command,
operable program or batch file.
So, I figured it must be a windows thing so tried to setup a proper working which command. Installed GnuWin32 using SourceForge and downloaded the source packages but in command prompt, it still said which is not a recognized command.
Then, tried another workaround using echo
echo %~$PATH:1
and saving it as a which.cmd file under WindowsApp in Local. Now when I run !which gcc it says
>> !which gcc
C:\Users\User\Documents\Folder\matconvnet>echo
ECHO is on.
and that's it.
How do I check and confirm the default compiler on my Matlab is C++?
  댓글 수: 1
Walter Roberson
Walter Roberson 2019년 7월 8일
mex -v -setup C++
will show you where it is finding gcc.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Write C Functions Callable from MATLAB (MEX Files)에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by