How do I change the MinGW gcc (tdm64-1) 4.9.2 to 6.3 version?

31 views (last 30 days)
I have installed version 6.3 however I am unable to reflect this change in my Matlab. What are the steps to be followed to change the version inside of Matlab?

Answers (2)

Shreeya
Shreeya on 26 Aug 2024
Hi
To update the MinGW GCC version used in MATLAB from 4.9.2 to 6.3, you can follow below steps:
  • Update MinGW to 6.3 and check the cuurent version through the following command
gcc --version
  • The MinGW version used is MATLAB is determined through the 'MW_MINGW64_LOC' environment variable. Ensure that the variable is set to the path of the required MinGW version.
  • Alternatively, you can set the 'MW_MINGW64_LOC' environment variable to the required path through the 'Edit the system environment variables' program in Windows 10/11.
  • Check the version used in MATLAB through the below command:
mex -setup -v
Also, according to the documentation linked below, the support for MinGW 6.3 was introduced in R2018b. Ensure that the compatible version of MATLAB is used.
Let me know if this helps!

Arjun
Arjun on 27 Aug 2024
From what I understand, you have installed new version of MinGW gcc compiler specifically 6.3 and you want MATLAB to use this version as opposed to the previous version.
I presume that you have correctly downloaded and installed the MinGW gcc Version 6.3 and your operating system is Windows.
To change the default compiler setting in MATLAB you can follow the following steps:
  1. Open MATLAB
  2. In the Command Window, run the following command: mex -setup C++
  3. MATLAB will search for installed compilers. If it detects the new MinGW installation, it will list it as an option. Choose the version 6.3 option.
  4. This will change the default compiler used by MATLAB.
As an additional caution, ensure that the path to the new MinGW installation is included in your system's PATH environment variable. This step may not be necessary if MATLAB is correctly configured, but it can help prevent issues with other software.
Kindly go through the following documentation link to explore more on how to change the default compiler settings: https://www.mathworks.com/help/matlab/matlab_external/choose-c-or-c-compilers.html
I hope this will help!

Tags

Products


Release

R2024a

Community Treasure Hunt

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

Start Hunting!